Skip to content

Commit ea5754c

Browse files
authored
SANDBOX-1568: fix flaky TestActivationCodeVerification/over_capacity test (#1247)
* fix flaky TestActivationCodeVerification/over_capacity test * add detailed comment
1 parent 9132258 commit ea5754c

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

test/e2e/parallel/registration_service_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,11 @@ func TestActivationCodeVerification(t *testing.T) {
854854
event := testsocialevent.NewSocialEvent(hostAwait.Namespace, commonsocialevent.NewName(),
855855
testsocialevent.WithUserTier("deactivate80"),
856856
testsocialevent.WithSpaceTier("base1ns6didler"),
857+
// MaxAttendees is set to 0 to simulate event being already full
858+
// We use this approach instead of manipulating ActivationCount to avoid flakiness
859+
// if the controller reconciliation is triggered by other parallel test, the ActivationCount
860+
// would be recalculated to 0 (due to the counting of approved UserSignups) and the test would fail.
861+
testsocialevent.WithMaxAttendees(0),
857862
testsocialevent.WithTargetCluster(member2Await.ClusterName))
858863
err := hostAwait.CreateWithCleanup(t, event)
859864
require.NoError(t, err)
@@ -862,12 +867,6 @@ func TestActivationCodeVerification(t *testing.T) {
862867
Status: corev1.ConditionTrue,
863868
})) // need to reload event
864869
require.NoError(t, err)
865-
event, err = wait.For(t, hostAwait.Awaitility, &toolchainv1alpha1.SocialEvent{}).
866-
UpdateStatus(event.Name, hostAwait.Namespace,
867-
func(ev *toolchainv1alpha1.SocialEvent) {
868-
ev.Status.ActivationCount = event.Spec.MaxAttendees // activation count identical to `MaxAttendees`
869-
})
870-
require.NoError(t, err)
871870

872871
userSignup, token := signup(t, hostAwait)
873872

0 commit comments

Comments
 (0)