fix: increase test timeout to 10s, listen on 127.0.0.1 only

This is to try to fix test reliability in GitHub actions.
This commit is contained in:
Adam Eijdenberg
2024-02-06 10:14:40 +11:00
parent 8becd574cb
commit ce15402f74

View File

@@ -235,11 +235,11 @@ func TestHttpListen(t *testing.T) {
} }
for _, args := range [][]string{ for _, args := range [][]string{
{"--no-auth", "--path", filepath.Join(td, "data"), "--listen", ":0"}, // test emphemeral 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", ":9000"}, // test "normal" 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", ":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: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 { for _, test := range []struct {
Path string Path string
StatusCode int StatusCode int