Make tests that wait for concurrent work wait on the event or a condition with a long deadline (issue 1814)
A test that slept a fixed time and then asserted what a goroutine, process or watcher did failed under the checker's load. Each now waits for its positive evidence (a started baseline, a call counted, a state reached) within 30 s, and the concurrency-limit tests meet at a barrier instead of overlapping by sleep. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
@@ -185,7 +185,7 @@ func TestTheVerbsOnTheMachine(t *testing.T) {
|
||||
defer cancel()
|
||||
sock := filepath.Join(g.Dir, "verbs.sock")
|
||||
go func() { _ = g.Serve(ctx, sock) }()
|
||||
for i := 0; i < 100; i++ {
|
||||
for i := 0; i < 3000; i++ {
|
||||
if _, err := os.Stat(sock); err == nil {
|
||||
break
|
||||
}
|
||||
@@ -233,7 +233,7 @@ func TestTheVerbsOnTheMachine(t *testing.T) {
|
||||
select {
|
||||
case <-g.wake:
|
||||
g.Tick()
|
||||
case <-time.After(time.Second):
|
||||
case <-time.After(30 * time.Second):
|
||||
t.Fatal("taking the write did not wake the guard")
|
||||
}
|
||||
if contentOf(t, g.Path) != meshFile {
|
||||
|
||||
Reference in New Issue
Block a user