Skip to content

Commit 26e0898

Browse files
committed
refactor unit test to fix race condition
1 parent cd84dbe commit 26e0898

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

api/grpc/mpi/v1/command.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/grpc/mpi/v1/common.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/grpc/mpi/v1/files.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)