...
public async void TestGetX()
{
// Create a stub
var server = new TestServer();
// Connect to the stubbed server
using (var referance = TestingFactory.Create(Testing.Config))
{
// Add two elements
server.Element.AddX("Something");
server.Element.AddX("Something Else");
// Retrieve the elements via some api that the referance uses
var elements = await refferance.GetX().ConfigureAwait(false);
// Check that there are two elements
Assert.Equal(2, elements.Count);
}
await server.StopServerAsync().ConfigureAwait(false);
}
...
Half of the times I run this code it works fine, the other half it fails trying to get the elements at "var elements = await refferance.GetX().ConfigureAwait(false);" with the following error message:
If I retry to do the call it works always on the second try. Do you have any idea what would cause this issue?