Skip to content

Fix test assertions#261

Merged
kriszyp merged 3 commits intomainfrom
test/fix-cache-assertions
Mar 19, 2026
Merged

Fix test assertions#261
kriszyp merged 3 commits intomainfrom
test/fix-cache-assertions

Conversation

@kriszyp
Copy link
Copy Markdown
Member

@kriszyp kriszyp commented Mar 18, 2026

Now, with 15% less flakiness 🤞

@kriszyp kriszyp requested a review from a team as a code owner March 18, 2026 23:25
@kriszyp kriszyp force-pushed the test/fix-cache-assertions branch from a278103 to e435b15 Compare March 18, 2026 23:39
results.push(record);
}
assert.equal(results.length, 1);
assert.equal(sourceRequests, 2);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #250 attempts to fix the underlying problem that was causing this test to fail. By moving this assertion before the second get(), you're just making the test pass. No?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent of this test is verify that the accessing expired records through a query (that uses a secondary index) will trigger a load from source/origin. I think with timing, sometimes the record may expire again before the subsequent call to IndexedCachingTable.get(23), triggering a third source request, which is fine, we aren't really trying to verify that the subsequent get won't go to source, just that it works and is correct.

@kriszyp kriszyp merged commit 8797b07 into main Mar 19, 2026
22 checks passed
@kriszyp kriszyp deleted the test/fix-cache-assertions branch March 19, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants