diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7a7b75..ed6929c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: tests-and-reports: needs: build runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 90 steps: - uses: actions/checkout@v4 - name: Restore .snk file from secret diff --git a/UnitTest/StressTest.cs b/UnitTest/StressTest.cs index 579814c..c0f9188 100644 --- a/UnitTest/StressTest.cs +++ b/UnitTest/StressTest.cs @@ -17,7 +17,7 @@ public StressTest(ITestOutputHelper output) _output = output; } - [Fact(Timeout = 15 * 60 * 1000)] + [Fact(Timeout = 30 * 60 * 1000)] public async Task StressTest1() { _output.WriteLine($"Testing {GetType().Name}.{MethodBase.GetCurrentMethod().ReflectedType.Name}"); @@ -28,27 +28,10 @@ await Task.Run(async () => int totalTasks = 1000000; - int doneCount = 0; - int failedCount = 0; - - bool done = false; - - _ = Task.Run(async () => - { - while (!done) - { - await Task.Delay(10000); - - string log = ""; - log = "doneCount: " + doneCount + "/" + totalTasks + " | failedCount: " + failedCount + " | powerPool.RunningWorkerCount: " + powerPool.RunningWorkerCount + " | powerPool.WaitingWorkCount: " + powerPool.WaitingWorkCount + " | powerPool.IdleWorkerCount: " + powerPool.IdleWorkerCount + " | powerPool.AliveWorkerCount: " + powerPool.AliveWorkerCount + " | powerPool.MaxThreads: " + powerPool.PowerPoolOption.MaxThreads; - _output.WriteLine(log + " | PoolRunning: " + powerPool.PoolRunning); - } - }); - for (int i = 0; i < 100; ++i) { - doneCount = 0; - failedCount = 0; + int doneCount = 0; + int failedCount = 0; powerPool.EnablePoolIdleCheck = false; @@ -83,13 +66,11 @@ await Task.Run(async () => } } - done = true; - powerPool.Dispose(); }); } - [Fact(Timeout = 15 * 60 * 1000)] + [Fact(Timeout = 30 * 60 * 1000)] public async Task StressTest2() { _output.WriteLine($"Testing {GetType().Name}.{MethodBase.GetCurrentMethod().ReflectedType.Name}"); @@ -249,7 +230,7 @@ await Task.Run(async () => }); } - [Fact(Timeout = 15 * 60 * 1000)] + [Fact(Timeout = 30 * 60 * 1000)] public async Task StressTest3() { _output.WriteLine($"Testing {GetType().Name}.{MethodBase.GetCurrentMethod().ReflectedType.Name}"); @@ -260,21 +241,6 @@ await Task.Run(async () => int totalTasks = 100; int doneCount = 0; - - bool done = false; - - _ = Task.Run(async () => - { - while (!done) - { - await Task.Delay(10000); - - string log = ""; - log = "doneCount: " + doneCount + "/" + 100 * 1000000 + " | powerPool.RunningWorkerCount: " + powerPool.RunningWorkerCount + " | powerPool.WaitingWorkCount: " + powerPool.WaitingWorkCount + " | powerPool.IdleWorkerCount: " + powerPool.IdleWorkerCount + " | powerPool.AliveWorkerCount: " + powerPool.AliveWorkerCount + " | powerPool.MaxThreads: " + powerPool.PowerPoolOption.MaxThreads; - _output.WriteLine(log + " | PoolRunning: " + powerPool.PoolRunning); - } - }); - for (int i = 0; i < 1000000; ++i) { powerPool.EnablePoolIdleCheck = false; @@ -303,13 +269,11 @@ await Task.Run(async () => Assert.Fail(errLog + " | PoolRunning: " + powerPool.PoolRunning); } - done = true; - powerPool.Dispose(); }); } - [Fact(Timeout = 15 * 60 * 1000)] + [Fact(Timeout = 30 * 60 * 1000)] public async Task StressTest4() { _output.WriteLine($"Testing {GetType().Name}.{MethodBase.GetCurrentMethod().ReflectedType.Name}");