Skip to content

Commit 80c4cbf

Browse files
committed
Make a test scenario less stressful.
1 parent ae7e004 commit 80c4cbf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tests/GC/API/GC/GetTotalAllocatedBytes.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static void TestAnotherThread()
110110
object lck = new object();
111111

112112
tsk = Task.Run(() => {
113-
while (running)
113+
for (int i = 0; i < 1000; i++)
114114
{
115115
Thread thd = new Thread(() => {
116116
lock (lck)
@@ -121,11 +121,14 @@ public static void TestAnotherThread()
121121

122122
thd.Start();
123123
thd.Join();
124+
125+
if (!running)
126+
break;
124127
}
125128
});
126129

127130
Counts previous = default(Counts);
128-
for (int i = 0; i < 1000; ++i)
131+
for (int i = 0; i < 100; ++i)
129132
{
130133
lock (lck)
131134
{

0 commit comments

Comments
 (0)