Fix float comparison in duration encode mockapi for query and header params#9945
Open
Fix float comparison in duration encode mockapi for query and header params#9945
Conversation
…eader params Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix float comparison logic in mockapi for e2e tests
Fix float comparison in duration encode mockapi for query and header params
Mar 6, 2026
commit: |
17 tasks
Collaborator
|
You can try these changes here
|
XiaofeiCao
approved these changes
Mar 6, 2026
timotheeguerin
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Float-typed duration values transmitted as query/header params were compared as strings, causing valid representations like
"35625.0"to fail against expected"35625"even though they're numerically equal.Changes
createQueryFloatServerTestshelper: UsesparseFloat()for numeric comparison instead of string equality for float query param scenarioscreateHeaderFloatServerTestshelper: Same numeric comparison approach for float header scenariosfloatMilliseconds/float64Milliseconds(35625)floatSecondsLargerUnit(150)floatMillisecondsLargerUnit(210000)Non-float scenarios (int32, iso8601) and non-ambiguous floats like
35.625are unchanged — their string comparison remains appropriate.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.