mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 23:01:44 +01:00
Troublehsooting ReleaseOnCancelClient
This commit is contained in:
parent
5c32356835
commit
97c2c2d127
@ -308,6 +308,9 @@ namespace Capnp.Net.Runtime.Tests
|
|||||||
--handleCount;
|
--handleCount;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "getCallSequence":
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Assert.Fail("Unexpected output");
|
Assert.Fail("Unexpected output");
|
||||||
break;
|
break;
|
||||||
@ -318,12 +321,13 @@ namespace Capnp.Net.Runtime.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
var verifyOutputTask = VerifyOutput();
|
var verifyOutputTask = VerifyOutput();
|
||||||
|
var taskList = new List<Task>();
|
||||||
|
|
||||||
for (int i = 0; i < iterationCount; i++)
|
for (int i = 0; i < iterationCount; i++)
|
||||||
{
|
{
|
||||||
var task = main.GetHandle(default);
|
var task = main.GetHandle(default);
|
||||||
Impatient.GetAnswer(task).Dispose();
|
Impatient.GetAnswer(task).Dispose();
|
||||||
task.ContinueWith(t =>
|
taskList.Add(task.ContinueWith(t =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -332,9 +336,19 @@ namespace Capnp.Net.Runtime.Tests
|
|||||||
catch (TaskCanceledException)
|
catch (TaskCanceledException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure that all answers either return (probably in canceled state)
|
||||||
|
Assert.IsTrue(Task.WhenAll(taskList).Wait(LargeNonDbgTimeout));
|
||||||
|
|
||||||
|
// Not part of original test. "Terminate" sequence with
|
||||||
|
// call to some different operation: getCallSequence
|
||||||
|
// Motivation: Cancelling the GetHandle request immediately after sending it might seduce the
|
||||||
|
// remote RPC implementation to immediately discard the request, before even calling the server
|
||||||
|
// method. => Cannot rely on receiving *exactly* 2*iterationCount outputs.
|
||||||
|
var term = main.GetCallSequence(0, default);
|
||||||
|
|
||||||
Assert.IsTrue(verifyOutputTask.Wait(LargeNonDbgTimeout));
|
Assert.IsTrue(verifyOutputTask.Wait(LargeNonDbgTimeout));
|
||||||
|
|
||||||
// Not part of original test. Ensure that there is no unwanted extra output
|
// Not part of original test. Ensure that there is no unwanted extra output
|
||||||
|
Loading…
x
Reference in New Issue
Block a user