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:
@@ -380,7 +380,7 @@ func TestTheKnowledgeBaseOverTheBus(t *testing.T) {
|
||||
t.Fatalf("history: %+v", h)
|
||||
}
|
||||
// Every change said on the bus, as the module, with who acted.
|
||||
deadline := time.Now().Add(5 * time.Second)
|
||||
deadline := time.Now().Add(30 * time.Second)
|
||||
for time.Now().Before(deadline) && len(w.of(EventProposed)) == 0 {
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func whoCalled(t *testing.T, params map[string]any) string {
|
||||
select {
|
||||
case who := <-got:
|
||||
return who
|
||||
case <-time.After(3 * time.Second):
|
||||
case <-time.After(30 * time.Second):
|
||||
t.Fatal("the call was not answered")
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user