Skip to content

Commit

Permalink
fix: Correctly throw for Event.WaitFor timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Aug 21, 2024
1 parent 6bb40b4 commit c5e8cf7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal async Task<bool> WaitForDefault(int timeout = 5000, CancellationToken c

if (winningTask == timeoutTask)
{
return false;
throw new TimeoutException("Timed out waiting for event to fire");
}

return await tcs.Task;
Expand All @@ -37,8 +37,15 @@ public async Task<bool> WaitForNoThrow(int timeoutValueMs, bool enforceUnderDebu
// timeoutValueMs = INFINITE;
//}

// TODO:MZ: Is this ok?
return !await WaitForDefault(timeoutValueMs);
try
{
await WaitForDefault(timeoutValueMs);
return true;
}
catch (TimeoutException)
{
return false;
}
//return WaitForSingleObject(m_handle, timeoutValueMs) == WAIT_OBJECT_0;
}

Expand Down

0 comments on commit c5e8cf7

Please sign in to comment.