Fix flaky Wolverine.Http.Tests#2218
Merged
jeremydmiller merged 3 commits intoJasperFx:mainfrom Feb 24, 2026
Merged
Conversation
Member
|
Good catch. I'm 100% Rider and then GitHub actions, and there is some variability with how different test harnesses will run tests in different order that can mask issues like you hit. Thanks for taking the time to work through that! |
Member
|
@dmytro-pryvedeniuk Do you want this in now, or do you have other things you want to push later? I'm not in a hurry for a Wolverine release, but there's a new bug to mess with I guess. |
…tDisposedException
Contributor
Author
Contributor
Author
|
I see there are other tests failing on GitHub, but I assume they are flaky themselves. My changes are related to Wolverine.Http.Tests only. |
Contributor
Author
|
@jeremydmiller the PR is ready for review.
|
This was referenced Feb 26, 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.


This PR fixes an issue with Wolverine.Http tests. Note that the issue is not reproducible when the tests run on GitHub.
On my machine (Windows 11) Wolverine.Http tests always fail, both when running via cmd or from VS. There are different tests and failures: NullReferenceException, ObjectDisposedException, unexpected NotFound errors in AlbaHost.Scenario. See the screenshots below.
To reproduce it's enough to run 2 tests in VS, e.g.
multi_tenanted_session_factory_without_wolverine.can_do_the_tenancy_detectionandsoft_deleted_attribute_usage.try_it_out.If they run separately they succeed as expected even when running multiple times, but when they run together
try_it_outfails withNullReferenceException.Reasons:
soft_deleted_attribute_usage.try) runs together with a test that creates its own host (e.g.multi_tenanted_session_factory_without_wolverine.can_do_the_tenancy_detection) the latter manages to setWolverineOptions.RememberedApplicationAssemblyBEFORE Host creation inAppFixture.InitializeAsync. As the result the endpoints fromWolverineWebApican not be discovered in "integration" collection tests.IntegrationContextclass inScenariomethod tries to reset host when 404 status code is received. It's not nice as 404 can be a valid response. Also, it does not help and causesNullReferenceExceptionforsoft_deleted_attribute_usage.try_it_out.As a possible solution I set
WolverineOptions.RememberedApplicationAssemblyinIntegrationContextand remove dangerous ResetHost.Also,
can_not_compile_with_manual_discovery_by_defaulttest is "fixed" to make the outcome the same when running on GitHub (the scenario returns the expected error as 500 response) and locally (the scenario throws the expected exception directly). Have not managed to find the reason of such different behavior.