diff --git a/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_IntegrationTests.netcoreapp.cs b/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_IntegrationTests.netcoreapp.cs index 9b18dc3fd8f5..97fd672ba961 100644 --- a/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_IntegrationTests.netcoreapp.cs +++ b/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_IntegrationTests.netcoreapp.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Threading; using System.Threading.Tests; using Xunit; @@ -9,11 +10,23 @@ public partial class ThreadPoolBoundHandleTests { [Fact] [PlatformSpecific(TestPlatforms.Windows)] // ThreadPoolBoundHandle.BindHandle is not supported on Unix - [ActiveIssue("https://github.com/dotnet/runtime/issues/49700")] public unsafe void MultipleOperationsOverSingleHandle_CompletedWorkItemCountTest() { long initialCompletedWorkItemCount = ThreadPool.CompletedWorkItemCount; - MultipleOperationsOverMultipleHandles(); - ThreadTestHelpers.WaitForCondition(() => ThreadPool.CompletedWorkItemCount - initialCompletedWorkItemCount >= 2); + MultipleOperationsOverSingleHandle(); + long changeInCompletedWorkItemCount = 0; + try + { + ThreadTestHelpers.WaitForCondition(() => + { + changeInCompletedWorkItemCount = ThreadPool.CompletedWorkItemCount - initialCompletedWorkItemCount; + return changeInCompletedWorkItemCount >= 2; + }); + } + catch (Exception ex) + { + // Test likely timed out, include the change for more information + throw new AggregateException($"changeInCompletedWorkItemCount: {changeInCompletedWorkItemCount}", ex); + } } }