Repository navigation
chore: Serialize test collections to avoid flaky initialization timeouts - #75
Open
kinyoklion wants to merge 2 commits into
Open
kinyoklion wants to merge 2 commits into
kinyoklion wants to merge 2 commits into
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
3 tasks done
…et-test-serialize
kinyoklion
marked this pull request as ready for review
October 16, 2026 21:20
This branch has not been deployed
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.
Disables xUnit cross-collection parallelism for the test project so provider initialization tests stop flaking.
ClientIntegrationTestsandProviderTestsboth drive the process-globalApi.Instanceand useThread.Sleepplus 100 ms timers inside[Fact(Timeout = 5000)]; running those classes concurrently starves the thread pool and produces spuriousTest execution timed out after 5000 millisecondsfailures on loaded runners.xunit.runner.jsonwithparallelizeTestCollections: false, copied to the output directory from the csproj.net6.0leg ofci-build (macos-latest)on fix: Validate privateAttributes in evaluation context conversion #70 failedClientIntegrationTests.ItHandlesValidInitializationWhenClientIsReadyAfterADelayafter 1 ms of test body time, while the identicalnet8.0leg in the same job passed.Requirements
net8.0;net6.0/net471validated by CI)Details
Related issues
None. Surfaced while working on #69 and #70.
Describe the solution you've provided
These initialization tests are inherently global: they register handlers on
Api.Instanceand assert on event counts after fixed sleeps. Serializing collections removes the cross-class interference and the thread-pool contention that makes xUnit'sTimeoutfire even though the test body does almost no work. Tests inside a single class already ran sequentially, so this only changes inter-class scheduling; total suite time is unaffected in practice (~1s).Describe alternatives you've considered
Api.InstanceandThread.Sleep— larger change, and the OpenFeature API surface is intentionally a singleton, so some global usage is unavoidable.Timeoutvalues — hides the contention rather than removing it.Additional context
Local verification:
Link to Devin session: https://app.devin.ai/sessions/9f0be899af7842e0b6a7bfc6229084f6
Open in Devin Desktop: https://app.devin.ai/desktop/session/9f0be899af7842e0b6a7bfc6229084f6?variant=devin
Requested by: @kinyoklion
SDK-3255
Note
Overview
Turns off xUnit cross-collection parallelism for
LaunchDarkly.OpenFeature.ServerProvider.Testsso initialization suites that share process-global OpenFeatureApi.Instanceno longer run concurrently and trip 5s[Fact(Timeout)]failures under load.Adds
xunit.runner.jsonwithparallelizeTestCollections: falseand wires the test.csprojto copy it to the output directory so the runner picks up the setting in CI and locally. No product or test assertion behavior changes—only how test classes are scheduled.Reviewed by Cursor Bugbot for commit 18be761. Bugbot is set up for automated code reviews on this repo. Configure here.