ci: increase timeout fo gprc/dialer test
We have observed that the pkg/grpc dialer test occasionally times out
on CI. Potentially this is related to the recent enablement of the
race detector. We increase the timeout to 10 seconds in CI environments.
GitOrigin-RevId:
@@ -18,6 +18,7 @@ import (
"context"
"log"
"net"
+ "os"
"testing"
"time"
@@ -115,7 +116,11 @@ func TestTCPDial(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
- ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+ timeout := time.Second
+ if _, ok := os.LookupEnv("CI"); ok {
+ timeout = 10 * time.Second
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
dialer := libgrpc.TCPDialer{
@@ -137,7 +142,6 @@ func TestTCPDial(t *testing.T) {
})
}
})
-
}
// server is used to implement helloworld.GreeterServer.
