Skip to content

Attempt to re-enable components E2E tests #12790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2019
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.ExceptionServices;
using System.Threading;

namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures
Expand Down Expand Up @@ -52,13 +53,30 @@ protected static void RunInBackgroundThread(Action action)
{
var isDone = new ManualResetEvent(false);

ExceptionDispatchInfo edi = null;
new Thread(() =>
{
action();
try
{
action();
}
catch (Exception ex)
{
edi = ExceptionDispatchInfo.Capture(ex);
}

isDone.Set();
}).Start();

isDone.WaitOne();
if (!isDone.WaitOne(TimeSpan.FromSeconds(10)))
{
throw new TimeoutException("Timed out waiting for: " + action);
}

if (edi != null)
{
throw edi.SourceException;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't the cause of any problems, but it will cause the process to fail with a bad error if it ever throws. I saw this while looking for the source of the hang, and wanted to harden it.

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public override void Dispose()
{
// This can be null if creating the webhost throws, we don't want to throw here and hide
// the original exception.
Host?.Dispose();
Host?.StopAsync();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>Components.E2ETests</TestGroupName>

<SkipTests Condition="$(ContinuousIntegrationBuild) == 'true'" >true</SkipTests>
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
<BuildHelixPayload>false</BuildHelixPayload>

<!-- Run on platforms where we support Selenium -->
<SkipTests Condition="'$(SeleniumE2ETestsSupported)' != 'true'">true</SkipTests>

<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<BaseOutputPath />


<OutputPath />

</PropertyGroup>
Expand Down