Troubleshooting Embargo* TCs, some CM tweaks

This commit is contained in:
Christian Köllner 2019-08-21 19:48:04 +02:00
parent 20d480a770
commit 2e524ef628
3 changed files with 116 additions and 11 deletions

View File

@ -821,6 +821,89 @@ namespace Capnp.Net.Runtime.Tests
});
}
[TestMethod, Timeout(10000)]
public void EmbargoServer2()
{
LaunchCompatTestProcess("server:MoreStuff", stdout =>
{
int retry = 0;
label:
using (var client = new TcpRpcClient("localhost", TcpPort))
{
Assert.IsTrue(client.WhenConnected.Wait(MediumNonDbgTimeout), "client connect");
using (var main = client.GetMain<ITestMoreStuff>())
{
var resolving = main as IResolvingCapability;
bool success;
try
{
success = resolving.WhenResolved.Wait(MediumNonDbgTimeout);
}
catch
{
success = false;
}
if (!success)
{
if (++retry == 5)
{
Assert.Fail("Attempting to obtain bootstrap interface failed. Bailing out.");
}
goto label;
}
var cap = new TestCallOrderImpl();
cap.CountToDispose = 6;
#if DEBUG_DISPOSE
Skeleton.BeginAssertNotDisposed(cap);
#endif
var earlyCall = main.GetCallSequence(0, default);
var echo = main.Echo(cap, default);
using (var pipeline = echo.Result)
{
var call0 = pipeline.GetCallSequence(0, default);
var call1 = pipeline.GetCallSequence(1, default);
Assert.IsTrue(earlyCall.Wait(MediumNonDbgTimeout), "early call returns");
var call2 = pipeline.GetCallSequence(2, default);
Assert.IsTrue(echo.Wait(MediumNonDbgTimeout));
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);
#if DEBUG_DISPOSE
Skeleton.EndAssertNotDisposed(cap);
#endif
}
}
}
});
}
[TestMethod, Timeout(10000)]
public void EmbargoClient()
{
@ -897,7 +980,7 @@ namespace Capnp.Net.Runtime.Tests
LaunchCompatTestProcess("server:MoreStuff", EmbargoErrorImpl);
}
[TestMethod, Timeout(10000)]
[TestMethod, Timeout(30000)]
public void RepeatedEmbargoError()
{
LaunchCompatTestProcess("server:MoreStuff", stdout =>

View File

@ -4,6 +4,7 @@
// > vcpkg install capnproto
#include <iostream>
#include <thread>
#include <capnp/ez-rpc.h>
#include <kj/common.h>
#include "test.capnp.h"
@ -636,7 +637,20 @@ public:
return kj::READY_NOW;
}
kj::Promise<void> echo(EchoContext context)
kj::Promise<void> simpleLoop(int rem)
{
if (rem <= 0) {
return kj::READY_NOW;
}
else {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
return kj::evalLater([this, rem]() mutable {
return simpleLoop(rem - 1);
});
}
}
kj::Promise<void> echo(EchoContext context)
{
++callCount;
cout << "echo" << endl;
@ -644,7 +658,7 @@ public:
auto params = context.getParams();
auto result = context.getResults();
result.setCap(params.getCap());
return kj::READY_NOW;
return simpleLoop(100); // Loop a little to provoke real promise pipelining
}
kj::Promise<void> expectCancel(ExpectCancelContext context)

View File

@ -11,6 +11,14 @@ install:
- vcpkg integrate install
- vcpkg install capnproto
- cd %APPVEYOR_BUILD_FOLDER%
dotnet_csproj:
patch: true
file: '**\*.csproj;**\*.props;**\*.fsproj;**\*.xml;**\*.nuspec'
version: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}'
before_build:
- cmd: dotnet --version
- cmd: msbuild -ver
@ -28,17 +36,17 @@ build_script:
after_build:
# For once the build has completed
artifacts:
- path: Capnp.Net.Runtime\bin\Debug\Capnp.Net.Runtime.1.0.0.nupkg
name: Capnp.Net.Runtime.1.0.0_debug
- path: Capnp.Net.Runtime\bin\Debug
name: Capnp.Net.Runtime_debug
type: NuGetPackage
- path: Capnp.Net.Runtime\bin\Release\Capnp.Net.Runtime.1.0.0.nupkg
name: Capnp.Net.Runtime.1.0.0
- path: Capnp.Net.Runtime\bin\Release
name: Capnp.Net.Runtime
type: NuGetPackage
- path: chocolatey\install\capnpc-csharp-win-x86.1.0.0.nupkg
name: capnpc-csharp-win-x86.1.0.0
- path: chocolatey\install\capnpc-csharp-win-x86.{version}.nupkg
name: capnpc-csharp-win-x86
type: NuGetPackage
- path: chocolatey\install\capnpc-csharp.1.0.0.nupkg
name: capnpc-csharp.1.0.0
- path: chocolatey\install\capnpc-csharp.{version}.nupkg
name: capnpc-csharp
type: NuGetPackage
clone_depth: 1
test_script: