Keep three timeout tests' upper bounds well under the production timeouts, so a timeout that falls back to production still fails (issue 1814, review round 3)
Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
@@ -567,7 +567,7 @@ func TestAHelperThatDoesNotAnswerFailsTheRequestInTime(t *testing.T) {
|
|||||||
if err == nil || !errors.Is(err, errHelperSlow) {
|
if err == nil || !errors.Is(err, errHelperSlow) {
|
||||||
t.Fatalf("a silent helper answered: %v", err)
|
t.Fatalf("a silent helper answered: %v", err)
|
||||||
}
|
}
|
||||||
if time.Since(start) > 30*time.Second {
|
if time.Since(start) > 10*time.Second {
|
||||||
t.Fatalf("the request waited %s", time.Since(start))
|
t.Fatalf("the request waited %s", time.Since(start))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ func TestAJudgementWaitsItsTurnWithinTheBound(t *testing.T) {
|
|||||||
if err == nil || !strings.Contains(err.Error(), "another judgement") {
|
if err == nil || !strings.Contains(err.Error(), "another judgement") {
|
||||||
t.Fatalf("%v", err)
|
t.Fatalf("%v", err)
|
||||||
}
|
}
|
||||||
if time.Since(start) > 30*time.Second {
|
if time.Since(start) > 10*time.Second {
|
||||||
t.Fatal("waited past the bound")
|
t.Fatal("waited past the bound")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ func TestATimedOutCommandIsEndedWithItsChildren(t *testing.T) {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) // long enough for a loaded machine to start the shell and write the pid
|
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) // long enough for a loaded machine to start the shell and write the pid
|
||||||
defer cancel()
|
defer cancel()
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
r := ExecRunner(ctx, "sh", "-c", "sleep 30 & echo $! > "+pidFile+"; wait")
|
r := ExecRunner(ctx, "sh", "-c", "sleep 300 & echo $! > "+pidFile+"; wait")
|
||||||
if took := time.Since(start); took > 30*time.Second {
|
if took := time.Since(start); took > 10*time.Second {
|
||||||
t.Fatalf("the call waited %s for a child holding its output", took)
|
t.Fatalf("the call waited %s for a child holding its output", took)
|
||||||
}
|
}
|
||||||
if !r.TimedOut {
|
if !r.TimedOut {
|
||||||
|
|||||||
Reference in New Issue
Block a user