Skip to content

Fix flaky static initialization error #1404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek requested a review from a team as a code owner June 20, 2025 09:15
Copy link

Label error. Requires exactly 1 of: automation, breaking, bug, changelog:skip, chore, ci, dependencies, documentation, enhancement, feature, fix, redesign. Found:

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sadly not a long term fix, since the initialization might happen on any test following this pattern which is all.

Its static so that it will be shared amongs every instance of the type. Each [Fact] method will instantiate a new instance of the containing type.

Removing static alone would thus be enough to ensure each gets a non shared instance.

The static/lazy stuff might be a premature optimalization on my end.

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.

2 participants