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

[FLAKY TESTS] Fix several flaky specs #5110

Merged
merged 3 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/Akka.Streams.Tests/IO/OutputStreamSourceSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public void OutputStreamSource_must_not_leave_blocked_threads()
result.ToString().Should().Be("hello");
}

[Fact]
[Fact(Skip = "Racy")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test is racy

public void OutputStreamSource_must_correctly_complete_the_stage_after_close()
{
// actually this was a race, so it only happened in at least one of 20 runs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void Messages_can_be_muted_from_now_on_with_using()
[Fact]
public void Make_sure_async_works()
{
_testingEventFilter.ForLogLevel(LogLevel).Expect(1, TimeSpan.FromMilliseconds(100), () =>
_testingEventFilter.ForLogLevel(LogLevel).Expect(1, TimeSpan.FromSeconds(2), () =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to add a delay to account for GC

{
Task.Delay(TimeSpan.FromMilliseconds(10)).ContinueWith(t => { LogMessage("whatever"); });
});
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Tests/Pattern/BackoffSupervisorSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void BackoffSupervisor_must_support_default_stopping_strategy_when_using_
// TODO: use FilterException
EventFilter.Exception<TestException>().Expect(1, () =>
{
var supervisor = Create(OnStopOptions().WithDefaultStoppingStrategy());
var supervisor = Create(OnStopOptions().WithDefaultStoppingStrategy().WithManualReset());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a GC happened, supervisor might be delayed and auto reset might kick in, resetting the restart counter to 0, failing the test

supervisor.Tell(BackoffSupervisor.GetCurrentChild.Instance);
var c1 = ExpectMsg<BackoffSupervisor.CurrentChild>().Ref;
Watch(c1);
Expand Down