git » gofer » commit fe3d095

test: Use different read and write timeouts to avoid flaky test

author Alberto Bertogli
2026-10-30 20:07:36 UTC
committer Alberto Bertogli
2026-11-06 23:57:34 UTC
parent 615c82563ad92b194c69f671e13b5e63bd177c40

test: Use different read and write timeouts to avoid flaky test

In the /timeout/500ms test, both read and write timeouts were exceeded;
this caused some racy behaviour as, depending on timing, the connection
could be closed, or the server could return 502.

Both are correct, but the test setup expects the write deadline to fire
first, so this patch adjusts the timeouts in the test config to make the
test reproducible. Now, the write timeout is always exceeded first.

test/01-fe.yaml +3 -1

diff --git a/test/01-fe.yaml b/test/01-fe.yaml
index b42427a..5b09585 100644
--- a/test/01-fe.yaml
+++ b/test/01-fe.yaml
@@ -40,7 +40,9 @@ _routes: &routes
 
 _timeouts: &timeouts
   "/timeout/":
-    read: "200ms"
+    # Keep read later than write, so write is what makes the request fail in
+    # test.sh. If they are the same, the client may get a 502 instead.
+    read: "300ms"
     write: "200ms"
 
 reqlog: