@@ -342,11 +342,24 @@ public async ValueTask DisposeAsync()
342
342
343
343
public abstract class StreamTests : IClassFixture < StreamTestsFixture > , IDisposable
344
344
{
345
- #if DEBUG
346
- public const string SkipConst = "" ;
347
- #else
348
- public const string SkipConst = "Streaming tests are timing sensitive and brittle; useful for debug, but skipping here" ;
345
+ public class DebugTheoryAttribute : TheoryAttribute
346
+ {
347
+ public DebugTheoryAttribute ( )
348
+ {
349
+ #if ! DEBUG
350
+ Skip = "Streaming tests are timing sensitive and brittle; useful for debug, but skipping here" ;
349
351
#endif
352
+ }
353
+ }
354
+ public class DebugFactAttribute : FactAttribute
355
+ {
356
+ public DebugFactAttribute ( )
357
+ {
358
+ #if ! DEBUG
359
+ Skip = "Streaming tests are timing sensitive and brittle; useful for debug, but skipping here" ;
360
+ #endif
361
+ }
362
+ }
350
363
351
364
protected int Port => _fixture . Port ;
352
365
private readonly StreamTestsFixture _fixture ;
@@ -375,7 +388,7 @@ public void FooIsContractType()
375
388
public void FooHasMarshaller ( )
376
389
=> Assert . NotNull ( BinderConfiguration . Default . GetMarshaller < Foo > ( ) ) ;
377
390
378
- [ Theory ( Skip = SkipConst ) ]
391
+ [ DebugTheory ]
379
392
[ InlineData ( Scenario . RunToCompletion , DEFAULT_SIZE , CallContextFlags . None ) ]
380
393
[ InlineData ( Scenario . RunToCompletion , DEFAULT_SIZE , CallContextFlags . CaptureMetadata ) ]
381
394
[ InlineData ( Scenario . YieldNothing , 0 , CallContextFlags . IgnoreStreamTermination ) ]
@@ -440,7 +453,7 @@ void CheckHeaderState()
440
453
}
441
454
}
442
455
443
- [ Theory ( Skip = SkipConst ) ]
456
+ [ DebugTheory ]
444
457
[ InlineData ( Scenario . TakeNothingBadProducer , 0 , CallContextFlags . None ) ]
445
458
[ InlineData ( Scenario . TakeNothingBadProducer , 0 , CallContextFlags . CaptureMetadata ) ]
446
459
[ InlineData ( Scenario . FaultSuccessBadProducer , 0 , CallContextFlags . None ) ]
@@ -486,7 +499,7 @@ void CheckHeaderState()
486
499
}
487
500
}
488
501
489
- [ Theory ( Skip = SkipConst ) ]
502
+ [ DebugTheory ]
490
503
[ InlineData ( Scenario . FaultAfterYield , DEFAULT_SIZE , "after yield" , CallContextFlags . None ) ]
491
504
[ InlineData ( Scenario . FaultAfterYield , DEFAULT_SIZE , "after yield" , CallContextFlags . CaptureMetadata ) ]
492
505
[ InlineData ( Scenario . FaultBeforeYield , 0 , "before yield" , CallContextFlags . None ) ]
@@ -784,7 +797,7 @@ public async Task BlockingUnarySuccess(Scenario scenario, CallContextFlags flags
784
797
}
785
798
}
786
799
787
- [ Theory ( Skip = SkipConst ) ]
800
+ [ DebugTheory ]
788
801
[ InlineData ( 8 , 10 ) ]
789
802
[ InlineData ( 8 , 20 , 15 ) ]
790
803
[ InlineData ( 0 , 10 ) ]
@@ -829,7 +842,7 @@ public async Task ClientStreaming()
829
842
Assert . Equal ( Enumerable . Range ( 0 , 10 ) . Sum ( ) , result . Bar ) ;
830
843
}
831
844
832
- [ Theory ( Skip = SkipConst ) ]
845
+ [ DebugTheory ]
833
846
[ InlineData ( true ) ]
834
847
[ InlineData ( false ) ]
835
848
public async Task ServerStreaming ( bool fault )
0 commit comments