tests: make schema fixtures deterministic#273
Merged
fredbi merged 5 commits intoJul 23, 2026
Conversation
TestJSONSchemaSuite started the HTTP fixture server in a goroutine and immediately ran parallel tests, allowing clients to connect before the listener was ready. Create the listener synchronously and close the server during cleanup to remove the race. Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
The documentation examples should not depend on petstore.swagger.io. Load the repository fixture instead so the examples remain deterministic and work in offline build environments. Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
Member
|
Let's see if the magic works :) |
Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
fredbi
requested changes
Jul 23, 2026
fredbi
left a comment
Member
There was a problem hiding this comment.
Thanks. Moving up the test server is indeed a good improvement.
Could you just reinstate the comment in the example as suggested?
Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
Contributor
Author
|
Force refreshed this PR :) |
fredbi
approved these changes
Jul 23, 2026
Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
fredbi
approved these changes
Jul 23, 2026
fredbi
approved these changes
Jul 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #273 +/- ##
==========================================
+ Coverage 92.31% 92.37% +0.06%
==========================================
Files 24 24
Lines 3280 3280
==========================================
+ Hits 3028 3030 +2
+ Misses 166 165 -1
+ Partials 86 85 -1 ☔ View full report in Codecov by Harness. |
Member
|
Thank you for this fix |
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.
This PR removes two sources of nondeterminism from the validation examples and schema tests:
ListenAndServe.petstore.swagger.io.The cleanup path accepts the expected
http.ErrServerClosed.Tested with
go test ./....