Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Xunit.StaFact/Sdk/UISynchronizationContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Andrew Arnott. All rights reserved.
// Licensed under the Ms-PL license. See LICENSE file in the project root for full license information.

using System.Diagnostics;
using System.Runtime.ExceptionServices;

namespace Xunit.Sdk;
Expand Down Expand Up @@ -114,7 +115,9 @@ public override void Post(SendOrPostCallback d, object? state)
{
if (this.pumpingEnded)
{
throw new InvalidOperationException($"The message pump in '{this.name}' isn't running any more.");
// Include the stack trace in the exception message itself because in test runs,
// the only thing reported for diagnosing this failure is the exception message.
throw new InvalidOperationException($"The message pump in '{this.name}' isn't running any more. {new StackTrace()}");
}

lock (this.messageQueue)
Expand Down