Skip to content

Commit 68faf2d

Browse files
committed
fixup failing test attribs
1 parent 64b8714 commit 68faf2d

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

tests/protobuf-net.Grpc.Test.Integration/StreamTests.cs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,24 @@ public async ValueTask DisposeAsync()
342342

343343
public abstract class StreamTests : IClassFixture<StreamTestsFixture>, IDisposable
344344
{
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";
349351
#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+
}
350363

351364
protected int Port => _fixture.Port;
352365
private readonly StreamTestsFixture _fixture;
@@ -375,7 +388,7 @@ public void FooIsContractType()
375388
public void FooHasMarshaller()
376389
=> Assert.NotNull(BinderConfiguration.Default.GetMarshaller<Foo>());
377390

378-
[Theory(Skip = SkipConst)]
391+
[DebugTheory]
379392
[InlineData(Scenario.RunToCompletion, DEFAULT_SIZE, CallContextFlags.None)]
380393
[InlineData(Scenario.RunToCompletion, DEFAULT_SIZE, CallContextFlags.CaptureMetadata)]
381394
[InlineData(Scenario.YieldNothing, 0, CallContextFlags.IgnoreStreamTermination)]
@@ -440,7 +453,7 @@ void CheckHeaderState()
440453
}
441454
}
442455

443-
[Theory(Skip = SkipConst)]
456+
[DebugTheory]
444457
[InlineData(Scenario.TakeNothingBadProducer, 0, CallContextFlags.None)]
445458
[InlineData(Scenario.TakeNothingBadProducer, 0, CallContextFlags.CaptureMetadata)]
446459
[InlineData(Scenario.FaultSuccessBadProducer, 0, CallContextFlags.None)]
@@ -486,7 +499,7 @@ void CheckHeaderState()
486499
}
487500
}
488501

489-
[Theory(Skip = SkipConst)]
502+
[DebugTheory]
490503
[InlineData(Scenario.FaultAfterYield, DEFAULT_SIZE, "after yield", CallContextFlags.None)]
491504
[InlineData(Scenario.FaultAfterYield, DEFAULT_SIZE, "after yield", CallContextFlags.CaptureMetadata)]
492505
[InlineData(Scenario.FaultBeforeYield, 0, "before yield", CallContextFlags.None)]
@@ -784,7 +797,7 @@ public async Task BlockingUnarySuccess(Scenario scenario, CallContextFlags flags
784797
}
785798
}
786799

787-
[Theory(Skip = SkipConst)]
800+
[DebugTheory]
788801
[InlineData(8, 10)]
789802
[InlineData(8, 20, 15)]
790803
[InlineData(0, 10)]
@@ -829,7 +842,7 @@ public async Task ClientStreaming()
829842
Assert.Equal(Enumerable.Range(0, 10).Sum(), result.Bar);
830843
}
831844

832-
[Theory(Skip = SkipConst)]
845+
[DebugTheory]
833846
[InlineData(true)]
834847
[InlineData(false)]
835848
public async Task ServerStreaming(bool fault)

0 commit comments

Comments
 (0)