Skip to content

Commit

Permalink
RSDK-9748 Wait for machine to be running in module interceptors test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
benjirewis authored Jan 16, 2025
1 parent c90ee46 commit 7ae017d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions module/module_interceptors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ func TestOpID(t *testing.T) {
md := metadata.New(map[string]string{"opid": opIDOutgoing})
mdCtx := metadata.NewOutgoingContext(ctx, md)

// Wait for generic helper to build on machine (machine to report a state of "running.")
for {
mStatus, err := rc.GetMachineStatus(ctx, &robotpb.GetMachineStatusRequest{})
test.That(t, err, test.ShouldBeNil)
if mStatus.State == robotpb.GetMachineStatusResponse_STATE_RUNNING {
break
}
time.Sleep(50 * time.Millisecond)
}

// Do this twice, once with no opID set, and a second with a set opID.
for name, cCtx := range map[string]context.Context{"default context": ctx, "context with opid set": mdCtx} {
t.Run(name, func(t *testing.T) {
Expand Down

0 comments on commit 7ae017d

Please sign in to comment.