Skip to content

Commit

Permalink
Fixed race condition in DoubleInvocationTests
Browse files Browse the repository at this point in the history
  • Loading branch information
stidsborg committed Nov 29, 2023
1 parent 24f7407 commit 2b5d11b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected async Task SecondInvocationFailsOnSuspendedFlow(Task<IFunctionStore> s
(string input) => Suspend.UntilAfter(0).ToResult<string>()
);

_ = rFunc.Invoke(functionInstanceId.Value, param: "Hallo World");
await Safe.Try(() => rFunc.Invoke(functionInstanceId.Value, param: "Hallo World"));

var secondInvocationTask = rFunc.Invoke(functionInstanceId.Value, param: "Hallo World");
await BusyWait.UntilAsync(() => secondInvocationTask.IsCompleted);
Expand Down Expand Up @@ -104,7 +104,7 @@ protected async Task SecondInvocationFailsOnPostponedFlow(Task<IFunctionStore> s
(string input) => Postpone.For(100_000).ToResult<string>()
);

_ = rFunc.Invoke(functionInstanceId.Value, param: "Hallo World");
await Safe.Try(() => rFunc.Invoke(functionInstanceId.Value, param: "Hallo World"));

var secondInvocationTask = rFunc.Invoke(functionInstanceId.Value, param: "Hallo World");
await BusyWait.UntilAsync(() => secondInvocationTask.IsCompleted);
Expand Down Expand Up @@ -135,8 +135,8 @@ protected async Task SecondInvocationFailsOnFailedFlow(Task<IFunctionStore> stor
functionTypeId,
(string input) => Fail.WithException(new InvalidOperationException("Oh no")).ToResult<string>()
);
_ = rFunc.Invoke(functionInstanceId.Value, param: "Hallo World");

await Safe.Try(() => rFunc.Invoke(functionInstanceId.Value, param: "Hallo World"));

var secondInvocationTask = rFunc.Invoke(functionInstanceId.Value, param: "Hallo World");
await BusyWait.UntilAsync(() => secondInvocationTask.IsCompleted);
Expand Down

0 comments on commit 2b5d11b

Please sign in to comment.