Troubleshooting EmbargoServer TC

This commit is contained in:
Christian Köllner 2019-08-20 19:45:40 +02:00
parent b23cc54491
commit 44fd4edfe9
2 changed files with 31 additions and 31 deletions

View File

@ -773,43 +773,40 @@ namespace Capnp.Net.Runtime.Tests
} }
var cap = new TestCallOrderImpl(); var cap = new TestCallOrderImpl();
using (Skeleton.Claim(cap)) cap.CountToDispose = 6;
var earlyCall = main.GetCallSequence(0, default);
var echo = main.Echo(cap, default);
using (var pipeline = echo.Eager())
{ {
var earlyCall = main.GetCallSequence(0, default); var call0 = pipeline.GetCallSequence(0, default);
var call1 = pipeline.GetCallSequence(1, default);
var echo = main.Echo(cap, default); Assert.IsTrue(earlyCall.Wait(MediumNonDbgTimeout), "early call returns");
using (var pipeline = echo.Eager()) var call2 = pipeline.GetCallSequence(2, default);
Assert.IsTrue(echo.Wait(MediumNonDbgTimeout));
using (var resolved = echo.Result)
{ {
var call0 = pipeline.GetCallSequence(0, default); var call3 = pipeline.GetCallSequence(3, default);
var call1 = pipeline.GetCallSequence(1, default); var call4 = pipeline.GetCallSequence(4, default);
var call5 = pipeline.GetCallSequence(5, default);
Assert.IsTrue(earlyCall.Wait(MediumNonDbgTimeout), "early call returns"); Assert.IsTrue(call0.Wait(MediumNonDbgTimeout), "call 0 returns");
Assert.IsTrue(call1.Wait(MediumNonDbgTimeout), "call 1 returns");
var call2 = pipeline.GetCallSequence(2, default); Assert.IsTrue(call2.Wait(MediumNonDbgTimeout), "call 2 returns");
Assert.IsTrue(call3.Wait(MediumNonDbgTimeout), "call 3 returns");
Assert.IsTrue(echo.Wait(MediumNonDbgTimeout)); Assert.IsTrue(call4.Wait(MediumNonDbgTimeout), "call 4 returns");
using (var resolved = echo.Result) Assert.IsTrue(call5.Wait(MediumNonDbgTimeout), "call 5 returns");
{
var call3 = pipeline.GetCallSequence(3, default);
var call4 = pipeline.GetCallSequence(4, default);
var call5 = pipeline.GetCallSequence(5, default);
Assert.IsTrue(call0.Wait(MediumNonDbgTimeout), "call 0 returns");
Assert.IsTrue(call1.Wait(MediumNonDbgTimeout), "call 1 returns");
Assert.IsTrue(call2.Wait(MediumNonDbgTimeout), "call 2 returns");
Assert.IsTrue(call3.Wait(MediumNonDbgTimeout), "call 3 returns");
Assert.IsTrue(call4.Wait(MediumNonDbgTimeout), "call 4 returns");
Assert.IsTrue(call5.Wait(MediumNonDbgTimeout), "call 5 returns");
Assert.AreEqual(0u, call0.Result);
Assert.AreEqual(1u, call1.Result);
Assert.AreEqual(2u, call2.Result);
Assert.AreEqual(3u, call3.Result);
Assert.AreEqual(4u, call4.Result);
Assert.AreEqual(5u, call5.Result);
}
Assert.AreEqual(0u, call0.Result);
Assert.AreEqual(1u, call1.Result);
Assert.AreEqual(2u, call2.Result);
Assert.AreEqual(3u, call3.Result);
Assert.AreEqual(4u, call4.Result);
Assert.AreEqual(5u, call5.Result);
} }
} }
} }

View File

@ -514,8 +514,11 @@ namespace Capnp.Net.Runtime.Tests.GenImpls
public uint Count { get; set; } public uint Count { get; set; }
public uint? CountToDispose { get; set; }
public void Dispose() public void Dispose()
{ {
Assert.IsTrue(!CountToDispose.HasValue || Count == CountToDispose, "Must not dispose at this point");
} }
public Task<uint> GetCallSequence(uint expected, CancellationToken cancellationToken_) public Task<uint> GetCallSequence(uint expected, CancellationToken cancellationToken_)