davsync tests: TestSlowTransferIsNotCutShort's watchdog is a second, not 300 ms, over ~24 MB each way

A line that never stops is all this test sends, so a 300 ms watchdog only
catches the runner itself pausing: red on macOS in run 37693090857 at
7.99s, near the end of the GET, where a full run takes 7.23s and 8 runs
under 3x CPU oversubscription here all passed. The server's 40 ms gap is
still 25x inside the watchdog, the PUT's tail is still twice it, and with
allSent's extension taken out the test still fails ("took nothing for 1s
(PUT)").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yetoneandClaude Opus 5.5 committed 2026-10-08 06:21:51 +08:00
1 parent 700315dff5
commit 30a8ce2915
1 file changed
+8 -4
+8 -4
View File
@@ -152,7 +152,11 @@ func narrow(c net.Conn, buffer int) error {
// down, but never stops moving, is written and read in full (#657: 43 MB
// at 305 KB/s took 2.4 minutes, and a sync was given 2).
func TestSlowTransferIsNotCutShort(t *testing.T) {
shortStall(t, 300*time.Millisecond, 300*time.Millisecond)
// a second, not the 300 ms the other stall tests use: a macOS runner
// can stop the whole test for a few hundred ms, and here the line never
// stops, so such a pause is all a shorter watchdog would catch (red
// on macOS in run 37693090857, near the end of the GET)
shortStall(t, time.Second, time.Second)
// the PUT's last MBs cross the line twice the watchdog after magpie has
// handed them all over
s := &slowDAV{chunk: 256 << 10, gap: 40 * time.Millisecond, tail: 2 * stallAfter}
@@ -162,8 +166,8 @@ func TestSlowTransferIsNotCutShort(t *testing.T) {
t.Fatal(err)
}
d.client = client
// ~20 MB at 6.4 MB/s: 3 s each way
data := bytes.Repeat([]byte("magpie skill "), (20<<20)/13)
// ~24 MB at 6.4 MB/s: nearly 4 s each way
data := bytes.Repeat([]byte("magpie skill "), (24<<20)/13)
ctx := context.Background()
start := time.Now()
if _, err := d.put(ctx, data, ""); err != nil {
@@ -179,7 +183,7 @@ func TestSlowTransferIsNotCutShort(t *testing.T) {
if !bytes.Equal(got, data) {
t.Fatalf("read back %d bytes of %d", len(got), len(data))
}
if up < 5*stallAfter || down < 5*stallAfter {
if up < 3*stallAfter || down < 3*stallAfter {
t.Fatalf("the transfers (%s up, %s down) weren't slow enough to test anything", up, down)
}
}