Ensured WithTracing is safe when used with BeEquivalentTo globally#3067
Merged
dennisdoomen merged 1 commit intofluentassertions:mainfrom Jul 2, 2025
Merged
Conversation
7965d9c to
74b65e7
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that WithTracing is safe when used with BeEquivalentTo globally. It updates the release notes, adds a test to validate concurrent tracing behavior, and refactors the trace writer to be thread safe by using AsyncLocal.
- Updated release notes to include version 8.5.0 and related fixes/enhancements.
- Added a concurrent execution test in TracingSpecs to validate tracing safety.
- Refactored StringBuilderTraceWriter to use AsyncLocal for thread safety.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/_pages/releases.md | Updated release notes with version 8.5.0 fixes and enhancements. |
| Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs | Added a new test to ensure WithTracing works safely under concurrent conditions. |
| Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs | Refactored thread unsafe code by replacing direct state management with AsyncLocal. |
Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs
Outdated
Show resolved
Hide resolved
74b65e7 to
645df6d
Compare
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
645df6d to
017d4d7
Compare
Pull Request Test Coverage Report for Build 16028431685Details
💛 - Coveralls |
jnyrup
reviewed
Jun 29, 2025
Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs
Outdated
Show resolved
Hide resolved
jnyrup
reviewed
Jun 29, 2025
Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs
Outdated
Show resolved
Hide resolved
Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs
Outdated
Show resolved
Hide resolved
93d7291 to
e8df814
Compare
jnyrup
reviewed
Jun 30, 2025
Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs
Outdated
Show resolved
Hide resolved
6283f6d to
5f07848
Compare
jnyrup
reviewed
Jul 2, 2025
5f07848 to
3b21037
Compare
jnyrup
approved these changes
Jul 2, 2025
3b21037 to
6e4adc3
Compare
This was referenced Mar 20, 2026
This was referenced Mar 28, 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.
Solves #2619