Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mrfaizal
Copy link

Draft PR to validate test fix

@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Nov 14, 2025
Avoid floating point conversion imprecision
Fix linter error with black
Ensure URL encoding takes enough time so that cached version is measurably 10x faster
@mrfaizal mrfaizal changed the title WIP: Fix floating point test error fix: flaky tests due to imprecision in floating point calculation and performance test setup Nov 14, 2025
@mrfaizal mrfaizal marked this pull request as ready for review November 14, 2025 05:39
@mrfaizal mrfaizal requested review from a team as code owners November 14, 2025 05:39
@mrfaizal mrfaizal assigned vchudnov-g and unassigned Linchin Nov 14, 2025
coryan
coryan previously approved these changes Nov 14, 2025
result = wrapped_method(timeout=22)
# Using "result = wrapped_method(timeout=22)" fails since wrapped_method
# does floating point calculations that results in 21.987.. instead of 22
result = wrapped_method(timeout=timeout.ConstantTimeout(22))
Copy link
Contributor

Choose a reason for hiding this comment

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

Since ConstantTimeout is deprecated, we should the fdollowing:

  • with this code change, rename the test method to test_wrap_method_with_overriding_constant_timeout
  • either do the following now or create an issue (and put it in a TODO here) to do this separately: recreate test_wrap_method_with_overriding_timeout_as_a_number() that actually does overwrite the timeout with a number, and make that test method robust enough to handle the floating-point computations that occur in TimeToDeadlineTimeout, which is where the numeric timeout override gets processed.

Change code to skip flaky test and add a new test that uses a constant timeout instead of a number to check that override works
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Nov 15, 2025
@mrfaizal mrfaizal requested a review from vchudnov-g November 15, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants