Skip to content

Commit 4f67454

Browse files
committed
fix flakiness of authorization order e2e tests
On-behalf-of: @SAP [email protected]
1 parent 874eac1 commit 4f67454

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/e2e/authorizer/authorizationorder_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package authorizer
1919
import (
2020
"context"
2121
"testing"
22+
"time"
2223

2324
"github.com/stretchr/testify/require"
2425

@@ -126,6 +127,14 @@ func setupTest(t *testing.T, authOrder, webhookConfigFile string) (kcptestingser
126127

127128
server := kcptesting.PrivateKcpServer(t, kcptestingserver.WithCustomArguments(args...))
128129

130+
// The testing framework has a rare race condition where if you stop kcp too early after it became "ready",
131+
// it will run into loads of shutdown issues and the shutdown will take 3-4 minutes.
132+
// This can be easily avoided by simply waiting a few seconds here. Since the tests that use setupTest()
133+
// are very, very short anyway, this will not harm the test runtime overall, but make them much more
134+
// stable on some certain PCs/laptops.
135+
// See https://github.com/kcp-dev/kcp/issues/3488 for more information.
136+
time.Sleep(3 * time.Second)
137+
129138
kcpConfig := server.BaseConfig(t)
130139
kubeClusterClient, err := kcpkubernetesclientset.NewForConfig(kcpConfig)
131140
require.NoError(t, err)

0 commit comments

Comments
 (0)