Skip to content

Commit 5631ec7

Browse files
committed
Use volatile for WaitForExitTest
1 parent 6e9e118 commit 5631ec7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/Azure.Functions.Cli.Tests/ExtensionsTests/ProcessExtensionsTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace Azure.Functions.Cli.Tests.ExtensionsTests
99
{
1010
public class ProcessExtensionsTests
1111
{
12+
private volatile bool calledContinueWith = false;
13+
1214
[SkippableFact]
1315
public async Task WaitForExitTest()
1416
{
@@ -18,15 +20,14 @@ public async Task WaitForExitTest()
1820
Process process = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
1921
? Process.Start("cmd")
2022
: Process.Start("sh");
21-
var calledContinueWith = false;
2223

2324
process.WaitForExitAsync().ContinueWith(_ =>
2425
{
2526
calledContinueWith = true;
2627
}).Ignore();
2728

2829
process.Kill();
29-
for (var i = 0; !calledContinueWith && i < 5; i++)
30+
for (var i = 0; !calledContinueWith && i < 10; i++)
3031
{
3132
await Task.Delay(200);
3233
}

0 commit comments

Comments
 (0)