Skip to content

Conversation

@Pijukatel
Copy link
Collaborator

@Pijukatel Pijukatel commented Nov 14, 2025

Description

  • Fixes root cause for flakiness in test_crawler_statistics_persistence
  • Previously, BasicCrawler was manually emitting a persist state event when exiting. Now this should be done by the EventManager.
  • Statistics used to be double-persisted previously, and due to a race condition, the old state could be persisted sometimes. Now the statistics are persisted by themselves when exiting their own context, and not by the Crawler-emitted event
  • StatisticsState.crawler_runtime changed to a computed field in a backwards compatible way. This allows pushing the runtime calculation to the state and ensures consistency between attribute access and persistence. (This prevents a theoretical race condition when automatic persistence triggers almost at the same time as the crawler finishes, and again causes the scenario described above).

Issues

Testing

  • Stress testing in CI
  • Added unit test

Checklist

  • CI passed

Add test.
Remove redundant persist event in BasicCrawler.
Add stress test to flaky test
@Pijukatel Pijukatel closed this Nov 14, 2025
@github-actions github-actions bot added this to the 127th sprint - Tooling team milestone Nov 14, 2025
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Nov 14, 2025
@Pijukatel Pijukatel changed the title Fix flaky statistics test fix: Ensure persist state event emission when exiting EventManager context Nov 14, 2025
@Pijukatel Pijukatel reopened this Nov 14, 2025
@Pijukatel Pijukatel marked this pull request as ready for review November 14, 2025 14:26
@Pijukatel Pijukatel requested a review from vdusek November 14, 2025 14:30
Copy link
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

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

Nice 👍, LGTM

Copy link
Collaborator

@Mantisus Mantisus left a comment

Choose a reason for hiding this comment

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

LGTM

@Pijukatel Pijukatel merged commit 6a44f17 into master Nov 18, 2025
23 checks passed
@Pijukatel Pijukatel deleted the fix-flaky-statistics-test branch November 18, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test test_crawler_statistics_persistence is flaky

4 participants