Fix master CI: eviction-guard test premise after dropping unique index#495
Merged
Merged
Conversation
…ue index testAddDoesNotEvictRecentRowOnSamePidServer was asserting QueryException, which fired before #494 because the unique (pid, server) index rejected the second insert. With the unique constraint dropped, the second insert succeeds, so the test premise no longer holds and master CI failed. Reframe the test to verify what it actually cares about: the eviction guard (`modified <` threshold) inside add() must NOT remove a fresh row. After the second add() on the same (pid, server), assert the pre-existing fresh row still exists. Coverage of the threshold check is preserved; the duplicate-allowed behavior is already covered by testAddAllowsDuplicatePidServer.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #495 +/- ##
============================================
- Coverage 77.58% 77.55% -0.03%
Complexity 972 972
============================================
Files 45 45
Lines 3266 3262 -4
============================================
- Hits 2534 2530 -4
Misses 732 732 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Why master is red
PR #493 added
testAddDoesNotEvictRecentRowOnSamePidServer, asserting that a secondadd()on the same(pid, server)throwsQueryException(the unique-index collision). PR #494 then dropped that unique index, so the second insert now succeeds — the test fails on master.Fix
Reframe the test to verify what it actually cares about: the eviction guard inside
add()(themodified <threshold) must not touch a fresh row. After the secondadd()on the same(pid, server), assert the pre-existing fresh row still exists.The duplicate-allowed behavior is already covered by
testAddAllowsDuplicatePidServer(added in #494), so no coverage is lost.