Skip to content

Commit 6ac6473

Browse files
authored
test: update test comments and error message
Signed-off-by: GitHub <[email protected]>
1 parent f538d71 commit 6ac6473

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cns/deviceplugin/socketwatcher_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,13 @@ func TestWatchSocketCleanup(t *testing.T) {
181181
}
182182

183183
// 5. Watch the socket again
184-
// If the bug exists, this will return the OLD closed channel (ch1) or a closed channel
185184
ch2 := s.WatchSocket(context.Background(), socket)
186185

187-
// 6. Verify ch2 is NOT closed immediately
186+
// 6. Verify ch2 is open
188187
select {
189188
case <-ch2:
190-
t.Fatal("WatchSocket returned a closed channel on the second call! The map entry was likely not cleaned up.")
189+
t.Fatal("channel is closed but expected to be open")
191190
case <-time.After(200 * time.Millisecond):
192-
// If we wait a bit and it's still open, that's good.
191+
// Wait for at least one tick to ensure the watcher has had a chance to run.
193192
}
194193
}

0 commit comments

Comments
 (0)