Skip to content
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 .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 6 additions & 42 deletions UnitTest/StressTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand All @@ -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;

Expand Down Expand Up @@ -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}");
Expand Down Expand Up @@ -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}");
Expand All @@ -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;
Expand Down Expand Up @@ -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}");
Expand Down
Loading