File tree 3 files changed +26
-3
lines changed
src/Components/test/E2ETest
Infrastructure/ServerFixtures
3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 6
6
using System . IO ;
7
7
using System . Linq ;
8
8
using System . Reflection ;
9
+ using System . Runtime . ExceptionServices ;
9
10
using System . Threading ;
10
11
11
12
namespace Microsoft . AspNetCore . Components . E2ETest . Infrastructure . ServerFixtures
@@ -52,13 +53,30 @@ protected static void RunInBackgroundThread(Action action)
52
53
{
53
54
var isDone = new ManualResetEvent ( false ) ;
54
55
56
+ ExceptionDispatchInfo edi = null ;
55
57
new Thread ( ( ) =>
56
58
{
57
- action ( ) ;
59
+ try
60
+ {
61
+ action ( ) ;
62
+ }
63
+ catch ( Exception ex )
64
+ {
65
+ edi = ExceptionDispatchInfo . Capture ( ex ) ;
66
+ }
67
+
58
68
isDone . Set ( ) ;
59
69
} ) . Start ( ) ;
60
70
61
- isDone . WaitOne ( ) ;
71
+ if ( ! isDone . WaitOne ( TimeSpan . FromSeconds ( 10 ) ) )
72
+ {
73
+ throw new TimeoutException ( "Timed out waiting for: " + action ) ;
74
+ }
75
+
76
+ if ( edi != null )
77
+ {
78
+ throw edi . SourceException ;
79
+ }
62
80
}
63
81
}
64
82
}
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public override void Dispose()
24
24
{
25
25
// This can be null if creating the webhost throws, we don't want to throw here and hide
26
26
// the original exception.
27
+ Host ? . Dispose ( ) ;
27
28
Host ? . StopAsync ( ) ;
28
29
}
29
30
Original file line number Diff line number Diff line change 7
7
<TargetFramework >netcoreapp3.0</TargetFramework >
8
8
<TestGroupName >Components.E2ETests</TestGroupName >
9
9
10
- <SkipTests Condition =" $(ContinuousIntegrationBuild) == 'true'" >true</SkipTests >
11
10
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
12
11
<BuildHelixPayload >false</BuildHelixPayload >
12
+
13
+ <!-- Run on platforms where we support Selenium -->
14
+ <SkipTests Condition =" '$(SeleniumE2ETestsSupported)' != 'true'" >true</SkipTests >
13
15
14
16
<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
15
17
<BaseOutputPath />
18
+
19
+
16
20
<OutputPath />
17
21
18
22
</PropertyGroup >
You can’t perform that action at this time.
0 commit comments