Skip to content

Commit

Permalink
Fix TestError: Wait for process to terminate (#3201)
Browse files Browse the repository at this point in the history
Co-authored-by: Madush Soysa <[email protected]>
Co-authored-by: Pavan Navarathna <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 1708d6c commit f958887
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/kanx/kanx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,12 @@ func (s *KanXSuite) TestError(c *C) {
err = sp.cmd.Process.Kill()
c.Assert(err, IsNil)

ps, err = ListProcesses(ctx, addr)
c.Assert(err, IsNil)
c.Assert(ps, HasLen, 1)
_ = poll.Wait(ctx, func(context.Context) (bool, error) {
ps, err = ListProcesses(ctx, addr)
c.Assert(err, IsNil)
c.Assert(ps, HasLen, 1)
return ps[0].GetState() != ProcessState_PROCESS_STATE_RUNNING, nil
})
c.Assert(ps[0].GetPid(), Equals, p.GetPid())
c.Assert(ps[0].GetState(), Equals, ProcessState_PROCESS_STATE_FAILED)
c.Assert(ps[0].GetExitErr(), Equals, "signal: killed")
Expand Down

0 comments on commit f958887

Please sign in to comment.