Skip to content

Commit

Permalink
Fix GremlinServerContainer for AggregateException
Browse files Browse the repository at this point in the history
For some reason, we're now getting the underlying exception wrapped in
an AggregateException when we try to connect to the server when it
is not ready yet.

Signed-off-by: Florian Hockmann <[email protected]>
  • Loading branch information
FlorianHockmann committed Sep 9, 2021
1 parent a15ffe0 commit 1b97663
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/JanusGraph.Net.IntegrationTest/GremlinServerContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,15 @@ protected override async Task ContainerStarted()

private async Task<bool> IsServerStartedAsync()
{
using var client = new GremlinClient(new GremlinServer(Host, Port));
return await client.SubmitWithSingleResultAsync<bool>(ServerStartedCheckTraversal);
try
{
using var client = new GremlinClient(new GremlinServer(Host, Port));
return await client.SubmitWithSingleResultAsync<bool>(ServerStartedCheckTraversal);
}
catch (AggregateException e) when(e.InnerException != null)
{
throw e.InnerException;
}
}
}
}

0 comments on commit 1b97663

Please sign in to comment.