Give Orleans test silos distinct ports
CI / test (push) Successful in 1m31s
Details
CI / test (push) Successful in 1m31s
Details
This commit is contained in:
parent
7d2cda67f0
commit
f8f10dea35
|
|
@ -10,4 +10,10 @@ public sealed class OrleansOptions
|
||||||
public const string SectionName = "Orleans";
|
public const string SectionName = "Orleans";
|
||||||
|
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
|
|
||||||
|
/// <summary>Порт silo. По умолчанию стандартный Orleans 11111.</summary>
|
||||||
|
public int SiloPort { get; set; } = 11111;
|
||||||
|
|
||||||
|
/// <summary>Порт gateway. По умолчанию стандартный Orleans 30000.</summary>
|
||||||
|
public int GatewayPort { get; set; } = 30000;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ if (orleansOptions.Enabled)
|
||||||
{
|
{
|
||||||
// Один silo на инстанс сервера. Для нескольких реплик нужен настоящий
|
// Один silo на инстанс сервера. Для нескольких реплик нужен настоящий
|
||||||
// кластер (AdoNet/Redis clustering), но контракт грана уже готов.
|
// кластер (AdoNet/Redis clustering), но контракт грана уже готов.
|
||||||
silo.UseLocalhostClustering();
|
silo.UseLocalhostClustering(orleansOptions.SiloPort, orleansOptions.GatewayPort);
|
||||||
silo.Configure<GrainCollectionOptions>(options =>
|
silo.Configure<GrainCollectionOptions>(options =>
|
||||||
options.CollectionAge = TimeSpan.FromHours(12));
|
options.CollectionAge = TimeSpan.FromHours(12));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,16 @@ public class OrleansServerE2ETests
|
||||||
Assert.True(health.GetProperty("matches").GetInt32() >= 1);
|
Assert.True(health.GetProperty("matches").GetInt32() >= 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static WebApplicationFactory<Program> NewFactory() =>
|
private static WebApplicationFactory<Program> NewFactory()
|
||||||
new WebApplicationFactory<Program>().WithWebHostBuilder(builder =>
|
{
|
||||||
builder.UseSetting("Orleans:Enabled", "true"));
|
return new WebApplicationFactory<Program>().WithWebHostBuilder(builder =>
|
||||||
|
{
|
||||||
|
builder.UseSetting("Orleans:Enabled", "true");
|
||||||
|
// Не пересекаться с TestCluster из OrleansMatchTests.
|
||||||
|
builder.UseSetting("Orleans:SiloPort", "21111");
|
||||||
|
builder.UseSetting("Orleans:GatewayPort", "21000");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private static async Task<QueueAccepted> EnqueueAsync(
|
private static async Task<QueueAccepted> EnqueueAsync(
|
||||||
HttpClient http,
|
HttpClient http,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue