@@ -67,25 +67,33 @@ public async Task CallStopAsyncOnRequestThread_DoesNotHangIndefinitely(string pa
67
67
}
68
68
69
69
70
- [ ConditionalTheory ]
71
- [ InlineData ( HostingModel . InProcess ) ]
72
- [ InlineData ( HostingModel . OutOfProcess ) ]
73
- public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503 ( HostingModel hostingModel )
70
+ [ ConditionalFact ]
71
+ public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess ( )
74
72
{
75
- var deploymentResult = await DeployApp ( hostingModel ) ;
73
+ var deploymentResult = await DeployApp ( HostingModel . InProcess ) ;
76
74
77
75
AddAppOffline ( deploymentResult . ContentRoot ) ;
78
76
79
77
await AssertAppOffline ( deploymentResult ) ;
80
78
DeletePublishOutput ( deploymentResult ) ;
81
79
}
82
80
83
- [ ConditionalTheory ]
84
- [ InlineData ( HostingModel . InProcess ) ]
85
- [ InlineData ( HostingModel . OutOfProcess ) ]
86
- public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503 ( HostingModel hostingModel )
81
+ [ ConditionalFact ]
82
+ [ RequiresNewShim ]
83
+ public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess ( )
84
+ {
85
+ var deploymentResult = await DeployApp ( HostingModel . OutOfProcess ) ;
86
+
87
+ AddAppOffline ( deploymentResult . ContentRoot ) ;
88
+
89
+ await AssertAppOffline ( deploymentResult ) ;
90
+ DeletePublishOutput ( deploymentResult ) ;
91
+ }
92
+
93
+ [ ConditionalFact ]
94
+ public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess ( )
87
95
{
88
- var deploymentResult = await DeployApp ( hostingModel ) ;
96
+ var deploymentResult = await DeployApp ( HostingModel . InProcess ) ;
89
97
90
98
// Add app_offline without shared access
91
99
using ( var stream = File . Open ( Path . Combine ( deploymentResult . ContentRoot , "app_offline.htm" ) , FileMode . CreateNew , FileAccess . ReadWrite , FileShare . None ) )
@@ -99,19 +107,54 @@ public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503(HostingM
99
107
DeletePublishOutput ( deploymentResult ) ;
100
108
}
101
109
102
- [ ConditionalTheory ]
103
- [ InlineData ( HostingModel . InProcess , 500 , "500.0" ) ]
104
- [ InlineData ( HostingModel . OutOfProcess , 502 , "502.5" ) ]
105
- public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed ( HostingModel hostingModel , int statusCode , string content )
110
+ [ ConditionalFact ]
111
+ [ RequiresNewShim ]
112
+ public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess ( )
113
+ {
114
+ var deploymentResult = await DeployApp ( HostingModel . OutOfProcess ) ;
115
+
116
+ // Add app_offline without shared access
117
+ using ( var stream = File . Open ( Path . Combine ( deploymentResult . ContentRoot , "app_offline.htm" ) , FileMode . CreateNew , FileAccess . ReadWrite , FileShare . None ) )
118
+ using ( var writer = new StreamWriter ( stream ) )
119
+ {
120
+ await writer . WriteLineAsync ( "App if offline but you wouldn't see this message" ) ;
121
+ await writer . FlushAsync ( ) ;
122
+ await AssertAppOffline ( deploymentResult , "" ) ;
123
+ }
124
+
125
+ DeletePublishOutput ( deploymentResult ) ;
126
+ }
127
+
128
+ [ ConditionalFact ]
129
+ public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_InProcess ( )
130
+ {
131
+ var deploymentParameters = Fixture . GetBaseDeploymentParameters ( hostingModel : HostingModel . InProcess ) ;
132
+ deploymentParameters . WebConfigActionList . Add ( WebConfigHelpers . AddOrModifyAspNetCoreSection ( "processPath" , "nonexistent" ) ) ;
133
+
134
+ var deploymentResult = await DeployAsync ( deploymentParameters ) ;
135
+
136
+ var result = await deploymentResult . HttpClient . GetAsync ( "/" ) ;
137
+ Assert . Equal ( 500 , ( int ) result . StatusCode ) ;
138
+ Assert . Contains ( "500.0" , await result . Content . ReadAsStringAsync ( ) ) ;
139
+
140
+ AddAppOffline ( deploymentResult . ContentRoot ) ;
141
+
142
+ await AssertAppOffline ( deploymentResult ) ;
143
+ DeletePublishOutput ( deploymentResult ) ;
144
+ }
145
+
146
+ [ ConditionalFact ]
147
+ [ RequiresNewShim ]
148
+ public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_OutOfProcess ( )
106
149
{
107
- var deploymentParameters = Fixture . GetBaseDeploymentParameters ( hostingModel : hostingModel ) ;
150
+ var deploymentParameters = Fixture . GetBaseDeploymentParameters ( hostingModel : HostingModel . OutOfProcess ) ;
108
151
deploymentParameters . WebConfigActionList . Add ( WebConfigHelpers . AddOrModifyAspNetCoreSection ( "processPath" , "nonexistent" ) ) ;
109
152
110
153
var deploymentResult = await DeployAsync ( deploymentParameters ) ;
111
154
112
155
var result = await deploymentResult . HttpClient . GetAsync ( "/" ) ;
113
- Assert . Equal ( statusCode , ( int ) result . StatusCode ) ;
114
- Assert . Contains ( content , await result . Content . ReadAsStringAsync ( ) ) ;
156
+ Assert . Equal ( 502 , ( int ) result . StatusCode ) ;
157
+ Assert . Contains ( "502.5" , await result . Content . ReadAsStringAsync ( ) ) ;
115
158
116
159
AddAppOffline ( deploymentResult . ContentRoot ) ;
117
160
@@ -220,6 +263,7 @@ public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_InProcess()
220
263
}
221
264
222
265
[ ConditionalFact ]
266
+ [ RequiresNewShim ]
223
267
public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_OutOfProcess ( )
224
268
{
225
269
var deploymentResult = await AssertStarts ( HostingModel . OutOfProcess ) ;
@@ -234,12 +278,10 @@ public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_OutOfProcess()
234
278
DeletePublishOutput ( deploymentResult ) ;
235
279
}
236
280
237
- [ ConditionalTheory ]
238
- [ InlineData ( HostingModel . InProcess ) ]
239
- [ InlineData ( HostingModel . OutOfProcess ) ]
240
- public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks ( HostingModel hostingModel )
281
+ [ ConditionalFact ]
282
+ public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_InProcess ( )
241
283
{
242
- var deploymentResult = await DeployApp ( hostingModel ) ;
284
+ var deploymentResult = await DeployApp ( HostingModel . InProcess ) ;
243
285
244
286
AddAppOffline ( deploymentResult . ContentRoot ) ;
245
287
@@ -250,12 +292,37 @@ public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks(H
250
292
await AssertRunning ( deploymentResult ) ;
251
293
}
252
294
253
- [ ConditionalTheory ]
254
- [ InlineData ( HostingModel . InProcess ) ]
255
- [ InlineData ( HostingModel . OutOfProcess ) ]
256
- public async Task AppOfflineAddedAndRemovedStress ( HostingModel hostingModel )
295
+ [ ConditionalFact ]
296
+ [ RequiresNewShim ]
297
+ public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_OutOfProcess ( )
298
+ {
299
+ var deploymentResult = await DeployApp ( HostingModel . OutOfProcess ) ;
300
+
301
+ AddAppOffline ( deploymentResult . ContentRoot ) ;
302
+
303
+ await AssertAppOffline ( deploymentResult ) ;
304
+
305
+ RemoveAppOffline ( deploymentResult . ContentRoot ) ;
306
+
307
+ await AssertRunning ( deploymentResult ) ;
308
+ }
309
+
310
+ [ ConditionalFact ]
311
+ public async Task AppOfflineAddedAndRemovedStress_InProcess ( )
312
+ {
313
+ await AppOfflineAddAndRemovedStress ( HostingModel . InProcess ) ;
314
+ }
315
+
316
+ [ ConditionalFact ]
317
+ [ RequiresNewShim ]
318
+ public async Task AppOfflineAddedAndRemovedStress_OutOfProcess ( )
319
+ {
320
+ await AppOfflineAddAndRemovedStress ( HostingModel . OutOfProcess ) ;
321
+ }
322
+
323
+ private async Task AppOfflineAddAndRemovedStress ( HostingModel hostingModel )
257
324
{
258
- var deploymentResult = await AssertStarts ( hostingModel ) ;
325
+ var deploymentResult = await AssertStarts ( hostingModel ) ;
259
326
260
327
var load = Helpers . StressLoad ( deploymentResult . HttpClient , "/HelloWorld" , response =>
261
328
{
@@ -269,7 +336,7 @@ public async Task AppOfflineAddedAndRemovedStress(HostingModel hostingModel)
269
336
Assert . True ( statusCode == 200 || statusCode == 503 , "Status code was " + statusCode ) ;
270
337
} ) ;
271
338
272
- for ( int i = 0 ; i < 100 ; i ++ )
339
+ for ( int i = 0 ; i < 5 ; i ++ )
273
340
{
274
341
// AddAppOffline might fail if app_offline is being read by ANCM and deleted at the same time
275
342
RetryHelper . RetryOperation (
@@ -310,6 +377,7 @@ public async Task ConfigurationChangeStopsInProcess()
310
377
}
311
378
312
379
[ ConditionalFact ]
380
+ [ RequiresNewShim ]
313
381
public async Task ConfigurationChangeForcesChildProcessRestart ( )
314
382
{
315
383
var deploymentParameters = Fixture . GetBaseDeploymentParameters ( HostingModel . OutOfProcess ) ;
@@ -347,11 +415,21 @@ public async Task OutOfProcessToInProcessHostingModelSwitchWorks()
347
415
await deploymentResult . HttpClient . RetryRequestAsync ( "/HelloWorld" , r => r . Headers . Server . ToString ( ) . StartsWith ( "Microsoft" ) ) ;
348
416
}
349
417
350
- [ ConditionalTheory ]
351
- [ InlineData ( HostingModel . InProcess ) ]
352
- [ InlineData ( HostingModel . OutOfProcess ) ]
418
+ [ ConditionalFact ]
353
419
[ QuarantinedTest ( "https://github.com/dotnet/aspnetcore-internal/issues/1794" ) ]
354
- public async Task ConfigurationTouchedStress ( HostingModel hostingModel )
420
+ public async Task ConfigurationTouchedStress_InProcess ( )
421
+ {
422
+ await ConfigurationTouchedStress ( HostingModel . InProcess ) ;
423
+ }
424
+
425
+ [ ConditionalFact ]
426
+ [ RequiresNewShim ]
427
+ public async Task ConfigurationTouchedStress_OutOfProcess ( )
428
+ {
429
+ await ConfigurationTouchedStress ( HostingModel . OutOfProcess ) ;
430
+ }
431
+
432
+ private async Task ConfigurationTouchedStress ( HostingModel hostingModel )
355
433
{
356
434
var deploymentResult = await DeployAsync ( Fixture . GetBaseDeploymentParameters ( hostingModel ) ) ;
357
435
@@ -387,6 +465,7 @@ public async Task ConfigurationTouchedStress(HostingModel hostingModel)
387
465
}
388
466
389
467
[ ConditionalFact ]
468
+ [ RequiresNewShim ]
390
469
public async Task ClosesConnectionOnServerAbortOutOfProcess ( )
391
470
{
392
471
try
0 commit comments