Skip to content

Commit 5711b70

Browse files
committed
disable flaky test
1 parent 3299700 commit 5711b70

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

test/e2e/authorizer/serviceaccounts_test.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ import (
3535
"k8s.io/client-go/util/retry"
3636
"k8s.io/utils/ptr"
3737

38+
"github.com/kcp-dev/kcp/sdk/apis/core"
3839
"github.com/kcp-dev/kcp/sdk/apis/tenancy/v1alpha1/helper"
40+
kcpclientset "github.com/kcp-dev/kcp/sdk/client/clientset/versioned/cluster"
3941
"github.com/kcp-dev/kcp/test/e2e/framework"
4042
)
4143

@@ -47,8 +49,22 @@ func TestServiceAccounts(t *testing.T) {
4749
t.Cleanup(cancelFunc)
4850

4951
server := framework.SharedKcpServer(t)
50-
orgPath, _ := framework.NewOrganizationFixture(t, server)
51-
wsPath, _ := framework.NewWorkspaceFixture(t, server, orgPath)
52+
// TODO(mjudeikis): Remove this check once this is fixed: https://github.com/kcp-dev/kcp/issues/3289
53+
{
54+
cfg := server.BaseConfig(t)
55+
kcpClusterClient, err := kcpclientset.NewForConfig(cfg)
56+
require.NoError(t, err)
57+
58+
shards, err := kcpClusterClient.Cluster(core.RootCluster.Path()).CoreV1alpha1().Shards().List(ctx, metav1.ListOptions{})
59+
require.NoError(t, err, "failed to list shards")
60+
if len(shards.Items) > 1 {
61+
t.Skipf("This tests does not work in 2+ shard setup yet, got %d", len(shards.Items))
62+
return
63+
}
64+
}
65+
66+
orgPath, _ := framework.NewOrganizationFixture(t, server, framework.WithNameSuffix("-sa"))
67+
wsPath, _ := framework.NewWorkspaceFixture(t, server, orgPath, framework.WithNameSuffix("-source"))
5268

5369
cfg := server.BaseConfig(t)
5470
kubeClusterClient, err := kcpkubernetesclientset.NewForConfig(cfg)

0 commit comments

Comments
 (0)