From 30a8ce291571af44b0541dfa15833a3a0471d807 Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 8 Oct 2026 06:21:48 +0800 Subject: [PATCH] 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 --- internal/davsync/stall_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/davsync/stall_test.go b/internal/davsync/stall_test.go index c2713c10..e9b26863 100644 --- a/internal/davsync/stall_test.go +++ b/internal/davsync/stall_test.go @@ -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) } }