Fix test failures for real DB mode#116
Merged
Merged
Conversation
RahulRengeshOfficial
commented
Apr 30, 2026
- 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
- 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
There was a problem hiding this comment.
Pull request overview
This PR adjusts DCM log repository settings tests to be more reliable when running against a real database (non-mock), reducing cross-test collisions and unnecessary DB operations.
Changes:
- Remove
DeleteAllEntities()usage from validation-only tests that return before any DB interaction. - Update
TestDeleteLogRepoSettingsbyId_Successto delete/verify using the generated unique ID instead of a hardcoded ID. - Add a short wait after create (and keep an existing wait after delete) to mitigate cache/consistency timing issues in real DB mode.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+605
to
+609
| // Allow cache to refresh after create | ||
| time.Sleep(100 * time.Millisecond) | ||
|
|
||
| // Delete it - use the same uniqueID | ||
| respEntity := DeleteLogRepoSettingsbyId(uniqueID, "stb") |
Comment on lines
614
to
+618
| // Allow cache to refresh | ||
| time.Sleep(100 * time.Millisecond) | ||
|
|
||
| // Verify deletion | ||
| deleted := GetLogRepoSettings("delete-me") | ||
| deleted := GetLogRepoSettings(uniqueID) |
kelleyloder
approved these changes
Apr 30, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.