{
public class InvokeOnEventsThreadTests : SystemEventsTest
{
+ [ActiveIssue(38661, TargetFrameworkMonikers.NetFramework)]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
public void InvokeOnEventsThreadRunsAsynchronously()
{
var invoked = new AutoResetEvent(false);
SystemEvents.InvokeOnEventsThread(new Action(() => invoked.Set()));
- Assert.True(invoked.WaitOne(PostMessageWait * SystemEventsTest.ExpectedEventMultiplier));
+ Assert.True(invoked.WaitOne(PostMessageWait));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
actualThreadId = Thread.CurrentThread.ManagedThreadId;
invoked.Set();
}));
- Assert.True(invoked.WaitOne(PostMessageWait * SystemEventsTest.ExpectedEventMultiplier));
+ Assert.True(invoked.WaitOne(PostMessageWait));
Assert.Equal(expectedThreadId, actualThreadId);
}
finally
{
IntPtr s_hwnd = IntPtr.Zero;
- public const int PostMessageWait = 10000;
+ public const int PostMessageWait = 30_000;
public const int ExpectedEventMultiplier = 1000;
public const int UnexpectedEventMultiplier = 10;
{
// on an STA thread the HWND is created in the same thread synchronously when attaching to an event handler
// if we're on an MTA thread, a new thread is created to handle events and that thread creates the window, wait for it to complete.
- Assert.True(windowReadyEvent.WaitOne(PostMessageWait * ExpectedEventMultiplier));
+ Assert.True(windowReadyEvent.WaitOne(PostMessageWait));
}
}
}