Skip to content

Commit 2cd83d6

Browse files
xrstfkcp-ci-bot
authored andcommitted
fix flakiness in TestAPIExportBindingAuthorizer
The test's intention is to ensure there is 1 consumer per shard for the wildwest API. To achieve this it creates 1 workspace for each shard and then binds to the APIExport from within there. However the code failed to ensure that the logicalclusters for these workspaces are actually at least evenly distributed to every shard. This lead to flakiness as sometimes both logicalclusters were scheduled onto the same shard, and suddenly there was only one consumer shard and so the test faile. On-behalf-of: @SAP christoph.mewes@sap.com
1 parent c9513d2 commit 2cd83d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/e2e/virtual/apiexport/authorizer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,8 @@ func TestAPIExportBindingAuthorizer(t *testing.T) {
631631

632632
// Bind to second tenant workspace so url pops up. So we use this to check tenant1 access.
633633
for _, shard := range shards.Items {
634-
tenant2Path, _ := kcptesting.NewWorkspaceFixture(t, server, orgPath, kcptesting.WithName(shard.Name+"-tenant-2"))
634+
tenant2Path, _ := kcptesting.NewWorkspaceFixture(t, server, orgPath, kcptesting.WithName(shard.Name+"-tenant-2"), kcptesting.WithShard(shard.Name))
635+
635636
kcptestinghelpers.Eventually(t, func() (bool, string) {
636637
_, err = kcpClient.Cluster(tenant2Path).ApisV1alpha2().APIBindings().Create(ctx, apiBinding, metav1.CreateOptions{})
637638
return err == nil, fmt.Sprintf("Error creating APIBinding: %v", err)

0 commit comments

Comments
 (0)