Skip to content

Commit deb515a

Browse files
machichima金嘉淇10353800
authored andcommitted
[Test] Fix Apiserver flaky test (ray-project#3934)
* test: increase timeout for wait cluster condition Signed-off-by: machichima <[email protected]> * fix: add time unix after namespace to ensure unique Signed-off-by: machichima <[email protected]> --------- Signed-off-by: machichima <[email protected]>
1 parent b0df25a commit deb515a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

apiserver/test/e2e/apiserversdk/types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ package apiserversdk
22

33
import (
44
"context"
5+
"fmt"
56
"net/http"
67
"os"
78
"runtime"
89
"strings"
910
"testing"
11+
"time"
1012

1113
petnames "github.com/dustinkirkland/golang-petname"
1214
"github.com/stretchr/testify/require"
@@ -61,7 +63,7 @@ func NewEnd2EndTestingContext(t *testing.T) (*End2EndTestingContext, error) {
6163

6264
func newEnd2EndTestingContext(t *testing.T, options ...contextOption) (*End2EndTestingContext, error) {
6365
testingContext := &End2EndTestingContext{
64-
namespaceName: petnames.Generate(2, "-"),
66+
namespaceName: fmt.Sprintf("%s-%d", petnames.Generate(2, "-"), time.Now().UnixNano()),
6567
clusterName: petnames.Name(),
6668
}
6769
for _, o := range options {

apiserver/test/e2e/apiserversdk/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ func waitForClusterConditions(t *testing.T, tCtx *End2EndTestingContext, cluster
3434
}
3535
}
3636
return false
37-
}, 1*time.Minute, testPollingInterval).Should(gomega.BeTrue())
37+
}, 3*time.Minute, testPollingInterval).Should(gomega.BeTrue())
3838
}

apiserver/test/e2e/types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package e2e
22

33
import (
44
"context"
5+
"fmt"
56
"net/http"
67
"os"
78
"runtime"
@@ -75,7 +76,7 @@ func NewEnd2EndTestingContext(t *testing.T) (*End2EndTestingContext, error) {
7576

7677
func newEnd2EndTestingContext(t *testing.T, options ...contextOption) (*End2EndTestingContext, error) {
7778
testingContext := &End2EndTestingContext{
78-
namespaceName: petnames.Generate(2, "-"),
79+
namespaceName: fmt.Sprintf("%s-%d", petnames.Generate(2, "-"), time.Now().UnixNano()),
7980
computeTemplateName: petnames.Name(),
8081
clusterName: petnames.Name(),
8182
configMapName: petnames.Generate(2, "-"),

0 commit comments

Comments
 (0)