Skip to content

test(ics): check the parse cache directly instead of timing it - #727

Merged
Quorafind merged 1 commit into
masterfrom
test/ics-cache-not-timed
Nov 29, 2026
Merged

Quorafind merged 1 commit into
masterfrom
test/ics-cache-not-timed

Conversation

@Quorafind

Copy link
Copy Markdown
Member

The ICS caching test required the cached parse to take under half the time of the first one. Both take about 1 ms, and a cache hit still hashes the whole content, so CI timing noise flips the result: it failed #725's CI with 1.3 ms vs 2.8 ms. Like #709 did for the Chinese-tag timing test, this now asserts the behaviour instead:

  • the second parse of the same content doesn't parse again (unfoldLines runs once);
  • the cache holds one entry;
  • the returned events are copies, not the cached objects.

Test-only change.

"should benefit from caching on repeated parsing" required the cached parse to take under half the time of the first one. Both take about a millisecond, and the cache hit still hashes the whole content, so a GC pause on CI flips the result (it failed PR #725's CI with 1.3 ms vs 2.8 ms). Assert the cache behaviour instead: the second parse of the same content doesn't parse again (unfoldLines runs once), the cache holds one entry, and the result is a copy.
@Quorafind
Quorafind merged commit d684512 into master Nov 29, 2026
3 checks passed
@Quorafind
Quorafind deleted the test/ics-cache-not-timed branch November 29, 2026 03:46
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 29, 2026
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.

1 participant