Skip to content

Commit 9e9d10d

Browse files
spencerugboAkshay2191
authored andcommitted
refactor unit test to fix race condition (#1446)
1 parent 8a586de commit 9e9d10d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/command/command_service_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ func TestCommandService_receiveCallback_configApplyRequest(t *testing.T) {
116116
10*time.Millisecond,
117117
)
118118

119+
wg.Wait()
120+
119121
commandService.configApplyRequestQueueMutex.Lock()
120122
defer commandService.configApplyRequestQueueMutex.Unlock()
121123
assert.Len(t, commandService.configApplyRequestQueue, 1)
122-
wg.Wait()
123124
}
124125

125126
func TestCommandService_UpdateDataPlaneStatus(t *testing.T) {

0 commit comments

Comments
 (0)