Skip to content
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

Fix timing issues with Should().NotThrowAfter() #1076

Merged
merged 2 commits into from Jun 7, 2019

Conversation

Projects
None yet
3 participants
@dennisdoomen
Copy link
Member

commented Jun 4, 2019

Extended the existing ITimer abstraction and renamed it to IClock so all tests that rely on delays, waits and stopwatches can be tested in a reliable fashion. This should resolve the flakiness we've been experiences.

IMPORTANT

@dennisdoomen dennisdoomen force-pushed the dennisdoomen:FixTiming branch 3 times, most recently from 461a2c6 to f0ecd17 Jun 4, 2019

@lg2de
Copy link
Contributor

left a comment

Instead of "mystic" calculation of now in the TestingTimer I would prefer explicit control of timing within the tests.

Show resolved Hide resolved FluentAssertions.sln
Show resolved Hide resolved Src/FluentAssertions/Common/Clock.cs
Show resolved Hide resolved Src/FluentAssertions/Common/IClock.cs
Show resolved Hide resolved Src/FluentAssertions/Common/IClock.cs
Show resolved Hide resolved Tests/Shared.Specs/ExceptionAssertionSpecs.cs
Show resolved Hide resolved Tests/Shared.Specs/TestingTimer.cs Outdated
Show resolved Hide resolved Tests/Shared.Specs/TestingTimer.cs Outdated

@dennisdoomen dennisdoomen force-pushed the dennisdoomen:FixTiming branch from f0ecd17 to 7747e2f Jun 5, 2019

@dennisdoomen dennisdoomen changed the title [WIP] Fix timing issues with Should().NotThrowAfter() Fix timing issues with Should().NotThrowAfter() Jun 5, 2019

@dennisdoomen dennisdoomen requested a review from jnyrup Jun 5, 2019

@dennisdoomen dennisdoomen force-pushed the dennisdoomen:FixTiming branch from 7747e2f to 66f7bf1 Jun 5, 2019

Show resolved Hide resolved Src/FluentAssertions/Common/Clock.cs
Show resolved Hide resolved Tests/Shared.Specs/FormatterSpecs.cs
Show resolved Hide resolved Tests/Shared.Specs/FakeClock.cs Outdated
Show resolved Hide resolved Tests/Shared.Specs/FakeClock.cs Outdated
Show resolved Hide resolved Src/FluentAssertions/Specialized/FunctionAssertions.cs
Show resolved Hide resolved Src/FluentAssertions/Common/IClock.cs Outdated
Show resolved Hide resolved Tests/Shared.Specs/FakeClock.cs Outdated
Fixed a static mutable state problem under .NET Core 3.0.
For some reason, the formatting specs that change global state are executed in a different order sometimes. This revealed a unexpected side-effect of changing the global configuration.

@dennisdoomen dennisdoomen force-pushed the dennisdoomen:FixTiming branch from 66f7bf1 to 9303ce5 Jun 6, 2019

@dennisdoomen dennisdoomen requested a review from jnyrup Jun 6, 2019

@dennisdoomen dennisdoomen requested a review from jnyrup Jun 6, 2019

@jnyrup

jnyrup approved these changes Jun 6, 2019

Copy link
Collaborator

left a comment

But my two last comments still holds :)

@dennisdoomen

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2019

But my two last comments still holds :)

Which ones? I applied all your suggestions.

@dennisdoomen dennisdoomen force-pushed the dennisdoomen:FixTiming branch from 9303ce5 to f99b010 Jun 7, 2019

@dennisdoomen dennisdoomen force-pushed the dennisdoomen:FixTiming branch from f99b010 to 8ea6257 Jun 7, 2019

@dennisdoomen dennisdoomen requested a review from jnyrup Jun 7, 2019

@jnyrup

jnyrup approved these changes Jun 7, 2019

@dennisdoomen dennisdoomen merged commit 895ba26 into fluentassertions:master Jun 7, 2019

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@dennisdoomen dennisdoomen deleted the dennisdoomen:FixTiming branch Jun 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.