Skip to content

Conversation

@Pijukatel
Copy link
Collaborator

@Pijukatel Pijukatel commented Jun 19, 2025

Description

Replace datetime.now by time.perf_counter_ns in time difference calculations for request duration tracking to avoid possible issues connected to measured time resolution.
This fixes the flakiness of test_final_statistics that was happening on Windows and Python versions < 3.13.

Issues

Testing

Newly added test was stress tested 500x times on old implementation to see the test sensitivity. On the source code before this PR the new test failed for Windows and Python versions 3.9,3.10,3.11,3.12 all 500 times. It did not fail even once for Linux or Windows + Python 3.13.

@github-actions github-actions bot added this to the 117th sprint - Tooling team milestone Jun 19, 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 Jun 19, 2025
@Pijukatel Pijukatel force-pushed the use-perf-counter-for-request-duration branch from d8d49f8 to c29665d Compare June 19, 2025 07:58
@Pijukatel Pijukatel requested review from janbuchar and vdusek June 19, 2025 08:12
@Pijukatel Pijukatel marked this pull request as ready for review June 19, 2025 08:12
Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
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.

lgtm then

@Pijukatel Pijukatel merged commit 9e92f6b into master Jun 26, 2025
23 checks passed
@Pijukatel Pijukatel deleted the use-perf-counter-for-request-duration branch June 26, 2025 06:54
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.

Investigate and fix flakiness of test_final_statistics

4 participants