mirror of https://github.com/jackc/pgx.git
TestConnectWithFallback: increase timeout
on Windows connecting on a closed port takes about 2 seconds. You can test with something like this start := time.Now() _, err := d.DialContext(context.Background(), "tcp", "127.0.0.1:1") fmt.Printf("finished, time %s, err: %v\n", time.Since(start), err) This seems by design https://groups.google.com/g/comp.os.ms-windows.programmer.win32/c/jV6kRVY3BqM Generally TestConnectWithFallback takes about 8-9 seconds on Windows. Increase timeout to avoid random failures under loadpull/1648/head
parent
461b9fa36e
commit
b1f8055584
|
@ -496,7 +496,7 @@ func TestConnectWithRuntimeParams(t *testing.T) {
|
|||
func TestConnectWithFallback(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
|
||||
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
||||
|
|
Loading…
Reference in New Issue