orleans: Orleans.TestCluster cannot be used at the same time as the unit test. AspNetCore.TestServer is used at the same time.
Orleans.TestCluster cannot be used at the same time as the unit test. AspNetCore.TestServer is used at the same time. Is there any other solution?
var webHostBuilder = new WebHostBuilder().UseStartup<HttpStartup>();
this.Server = new TestServer(webHostBuilder);
var builder = new TestClusterBuilder(1);
builder.Options.BaseSiloPort = 1000; // this works, while ISiloBuilderConfigurator does not
builder.Options.BaseGatewayPort = 1001;
builder.AddClientBuilderConfigurator<ClientBuilderConfigurator>();
builder.AddSiloBuilderConfigurator<SiloBuilderConfigurator>();
var cluster = builder.Build();
cluster.DeployAsync().Wait();
this.Client = cluster.Client;
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (19 by maintainers)
This is how we worked around it:
And then just use
UseOrleans
:Are there problems with this workaround? There’s lots of stuff going on in the
Orleans.TestingHost
assembly which we skipped. Do you think you could build an API that would not require it? For example, anAddOrleans
method that works withIServiceCollection
.