Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make crowd test more stable #344

Merged
merged 8 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-no-domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
# boto3 ignores AWS creds env vars for some reason
mkdir -p ~/.aws
echo -e "[default]\naws_access_key_id = ${AWS_ACCESS_KEY_ID}\naws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}\naws_session_token = ${AWS_SESSION_TOKEN}" > ~/.aws/credentials
go test ./e2etest -v -timeout 85m -run Installer | tee ./e2etest/artifacts/e2etest.log
go test ./e2etest -v -timeout 100m -run Installer | tee ./e2etest/artifacts/e2etest.log

- name: Upload test log files
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-with-domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
# boto3 ignores AWS creds env vars for some reason
mkdir -p ~/.aws
echo -e "[default]\naws_access_key_id = ${AWS_ACCESS_KEY_ID}\naws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}\naws_session_token = ${AWS_SESSION_TOKEN}" > ~/.aws/credentials
go test ./e2etest -v -timeout 85m -run Installer | tee ./e2etest/artifacts/e2etest.log
go test ./e2etest -v -timeout 100m -run Installer | tee ./e2etest/artifacts/e2etest.log
- name: Upload test log files
if: always()
Expand Down
12 changes: 11 additions & 1 deletion test/e2etest/crowd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,28 @@ func crowdTests(t *testing.T, testConfig TestConfig, bitbucketURL string, crowdU
createNewCrowdUser(t, userName, crowdURL, testConfig.CrowdPassword)

// before making calls to Bitbucket make sure we land on the same node and avoid using sticky cookie in requests
// scale bitbucket to 1 replica instead of 3
// scale bitbucket to 1 replica instead of 3.
log.Print("Scaling Bitbucket to 1")
_, kubectlError := k8s.RunKubectlAndGetOutputE(t, getKubectlOptions(t, testConfig), "scale", "sts/bitbucket", "-n", "atlassian", "--replicas=1")
assert.Nil(t, kubectlError)
// we need to give Bitbucket some time to unregister Hazelcast nodes and update cluster setting
time.Sleep(15 * time.Second)

// get BITBUCKETSESSIONID to use in the header in subsequent calls
// even though basic auth works, atl_token is different each time
bitbucketSessionID := getBitbucketSessionID(bitbucketURL, "admin", testConfig.BitbucketPassword)
assert.NotEmptyf(t, bitbucketSessionID, "BITBUCKETSESSIONID cannot be empty")

// now we need to extract atl_token from the hidden input in HTML response
// we will try 5 times, as token is extracted from html output and the test proved
// to be quite flaky as the token was missing
atlToken := getAtlToken(t, bitbucketURL, bitbucketSessionID)
if atlToken == "" {
log.Printf("atl_token is empty. Retrying in 5 seconds")
time.Sleep(5 * time.Second)
atlToken = getAtlToken(t, bitbucketURL, bitbucketSessionID)
}

assert.NotEmptyf(t, atlToken, "atl_token cannot be empty")

// add a new user directory in Bitbucket
Expand Down
Loading