From ce15402f7495db433e63cf19fc2d97650dc342cd Mon Sep 17 00:00:00 2001 From: Adam Eijdenberg Date: Tue, 6 Feb 2024 10:14:40 +1100 Subject: [PATCH] fix: increase test timeout to 10s, listen on 127.0.0.1 only This is to try to fix test reliability in GitHub actions. --- cmd/rest-server/main_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/rest-server/main_test.go b/cmd/rest-server/main_test.go index 27037df..7366981 100644 --- a/cmd/rest-server/main_test.go +++ b/cmd/rest-server/main_test.go @@ -235,11 +235,11 @@ func TestHttpListen(t *testing.T) { } for _, args := range [][]string{ - {"--no-auth", "--path", filepath.Join(td, "data"), "--listen", ":0"}, // test emphemeral port - {"--no-auth", "--path", filepath.Join(td, "data"), "--listen", ":9000"}, // test "normal" port - {"--no-auth", "--path", filepath.Join(td, "data"), "--listen", ":9000"}, // test that server was shutdown cleanly and that we can re-use that port + {"--no-auth", "--path", filepath.Join(td, "data"), "--listen", "127.0.0.1:0"}, // test emphemeral port + {"--no-auth", "--path", filepath.Join(td, "data"), "--listen", "127.0.0.1:9000"}, // test "normal" port + {"--no-auth", "--path", filepath.Join(td, "data"), "--listen", "127.0.0.1:9000"}, // test that server was shutdown cleanly and that we can re-use that port } { - err := testServerWithArgs(args, time.Second, func(ctx context.Context, app *restServerApp) error { + err := testServerWithArgs(args, time.Second*10, func(ctx context.Context, app *restServerApp) error { for _, test := range []struct { Path string StatusCode int