Skip to content

Fixes #194. Some tests fail due to different cultures.#195

Open
BDisp wants to merge 3 commits into
gui-cs:developfrom
BDisp:issue/194_fix-tests-culture
Open

Fixes #194. Some tests fail due to different cultures.#195
BDisp wants to merge 3 commits into
gui-cs:developfrom
BDisp:issue/194_fix-tests-culture

Conversation

@BDisp
Copy link
Copy Markdown
Collaborator

@BDisp BDisp commented May 20, 2026

Fixes #194

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@tig
Copy link
Copy Markdown
Member

tig commented May 20, 2026

Concern: Process-global state mutation in parallel tests

CultureInfo.DefaultThreadCurrentCulture is process-wide. Setting it in each test class constructor races with parallel tests in the same assembly"

Suggested fix: Replace all three constructors with a single <InvariantGlobalization>true</InvariantGlobalization> in the integration test .csproj:

<PropertyGroup>
  <InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

This:

  • Applies invariant culture at the runtime level (no race)
  • Eliminates per-class boilerplate
  • Automatically covers new test classes
  • Doesn't mutate shared state from test code

If invariant globalization is too broad (e.g., some tests intentionally verify locale behavior), an alternative is a shared xUnit IAssemblyFixture that sets culture once at assembly startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some tests fail due to different cultures.

2 participants