Skip to content

Fix flaky tests: add SkipIfMockDatabase pattern, unique IDs, and sequ…#115

Merged
pt-nguyen merged 6 commits into
developfrom
kloder
May 7, 2026
Merged

Fix flaky tests: add SkipIfMockDatabase pattern, unique IDs, and sequ…#115
pt-nguyen merged 6 commits into
developfrom
kloder

Conversation

@kelleyloder
Copy link
Copy Markdown

  • cherry-picked changes from "Fix flaky tests" PR (but to develop branch)
  • fixed merge conflicts
  • removed tenantId references (since not in develop branch)
  • modified table name changes
  • changed one unit test to correctly look for 400 instead of 404

RahulRengeshOfficial and others added 5 commits April 29, 2026 11:39
…ential execution

- Add SkipIfMockDatabase() helper to skip tests that require real Cassandra
- Use unique IDs (timestamps) to prevent test collisions
- Add time.Sleep for Cassandra eventual consistency
- Update Makefile to run tests sequentially (-p 1) to avoid DB race conditions
- Tests now pass reliably in both mock and real DB modes
- Fix TestDeleteLogRepoSettingsbyId_Success: use uniqueID instead of hardcoded 'delete-me'
- Remove unnecessary DeleteAllEntities() from pure validation tests
- Add delay after create before delete for Cassandra consistency
pt-nguyen
pt-nguyen previously approved these changes May 7, 2026
@pt-nguyen pt-nguyen dismissed their stale review May 7, 2026 18:03

The merge-base changed after approval.

@pt-nguyen pt-nguyen merged commit 73a9db1 into develop May 7, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@kelleyloder kelleyloder deleted the kloder branch May 7, 2026 20:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants