diff --git a/src/coreclr/vm/profdetach.cpp b/src/coreclr/vm/profdetach.cpp index bf138209ce6ad6..09f11458c38871 100644 --- a/src/coreclr/vm/profdetach.cpp +++ b/src/coreclr/vm/profdetach.cpp @@ -326,7 +326,7 @@ void ProfilingAPIDetach::ExecuteEvacuationLoop() { CRITSEC_Holder csh(ProfilingAPIUtility::GetStatusCrst()); - for (SIZE_T pos = 0; pos < s_profilerDetachInfos.Size(); ++pos) + while (s_profilerDetachInfos.Size() > 0) { ProfilerDetachInfo current = s_profilerDetachInfos.Pop(); diff --git a/src/tests/profiler/multiple/multiple.cs b/src/tests/profiler/multiple/multiple.cs index 871217a890a6b7..0d686ae0691a94 100644 --- a/src/tests/profiler/multiple/multiple.cs +++ b/src/tests/profiler/multiple/multiple.cs @@ -37,7 +37,7 @@ public static int RunTest(String[] args) Console.WriteLine("Waiting for profilers to all detach"); if (!_profilerDone.WaitOne(TimeSpan.FromMinutes(10))) { - Console.WriteLine("Test timed out waiting for the profilers to set the callback, test will fail."); + throw new Exception("Test timed out waiting for the profilers to set the callback, test will fail."); } return 100;