fix(ui-tests): resolve two flaky onboarding Cypress test failures#7718
Draft
Copilot wants to merge 1 commit into
Draft
fix(ui-tests): resolve two flaky onboarding Cypress test failures#7718Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job ui-tests (onboarding)
fix(ui-tests): resolve two flaky onboarding Cypress test failures
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests 3 and 5 of the onboarding suite were failing intermittently due to two independent race conditions — one involving the write-batcher leaking data across tests, the other a timing gap in the populator progress-bar check.
Test 3 —
datatable-datapoints-sessions-0contains non-zero valueRoot cause: Countly's write-batcher (10 s flush interval) accumulates
server_stats_data_pointsincrements during test 2 (Entertainment demo). A singlecy.dropMongoDatabase()inbeforeEachdrops the DB, but the in-flight batch flushes milliseconds later into the freshly-recreated database. By the time test 3 reaches the data-points page,all-apps.sessionsis non-zero. Compounding the issue,el-table-column fixed="left"causes Element UI to render an extra shadow panel, producing two<span>elements with the samedata-test-id; Cypress asserts on their combined text.Fix: Drop the database twice in
beforeEach, separated by a ~12 s wait, so any write-batcher flush that occurs after the first drop lands in already-dropped storage and the second drop clears it:Test 5 — geo countries total-sessions h2 doesn't contain
"1000"Root cause:
checkPopulatorProgressBar()callscy.elementExists()— a synchronous DOM lookup with zero retry timeout. If the progress bar hasn't appeared yet (app-creation API call still in flight when the check fires),isExists === falseand the entire 120 s wait is silently skipped. The test then proceeds while the server is still processing populator sessions, so the aggregated geo total is < 1000.Fix: Remove the conditional existence check and always wait for the bar to appear first, then wait for it to disappear: