Skip to content

Deflake caching test 'Can load cached indexed data'#242

Draft
Ethan-Arrowood wants to merge 3 commits intomainfrom
deflake-caching-test
Draft

Deflake caching test 'Can load cached indexed data'#242
Ethan-Arrowood wants to merge 3 commits intomainfrom
deflake-caching-test

Conversation

@Ethan-Arrowood
Copy link
Copy Markdown
Member

@Ethan-Arrowood Ethan-Arrowood commented Mar 17, 2026

The test file unitTests/resources/caching.test.js has been flaky on harper CI, I’ve noticed it in multiple PR CI runs recently.

Can reproduce locally using:

for i in $(seq 1 50); do npm run test:unit -- unitTests/resources/caching.test.js --grep 'Can load cached indexed data'; done

The “TypeError: result.getExpiresAt is not a function” is easy to solve as we can just remove the last two lines that have no impact on the actual test:

		result = await IndexedCachingTable.get(23);
		console.log(result.getExpiresAt());

But the other error is more difficult. Bumping the timeout to 20ms didn't work, and mocha explicitly recommends avoiding using 1this.retries()` for unit tests. I'm really looking for a more deterministic solution here, or potentially a deep dive into why this specific circumstance is flaky when other tests in this file are not. This test file makes have use of timers so why is only this test flaking?

@Ethan-Arrowood
Copy link
Copy Markdown
Member Author

Related to #239

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.

1 participant