Fix most recent fix for ci test
This commit is contained in:
@@ -81,15 +81,19 @@ public class GatewayApiFixture : WebApplicationFactory<Program>, IAsyncLifetime
|
||||
await GatewayDbResetHelper.ResetAsync(migrateDb);
|
||||
}
|
||||
|
||||
using var scope = Services.CreateScope();
|
||||
var redis = scope.ServiceProvider.GetRequiredService<IConnectionMultiplexer>();
|
||||
var server = redis.GetServer(redis.GetEndPoints().First());
|
||||
// Flush only the gateway test DB index — do not FlushAll (would wipe API test DB 1).
|
||||
// Must run before Services is touched: host startup saturates the thread pool and
|
||||
// causes StackExchange.Redis TimeoutException on FLUSHDB under CI load.
|
||||
var dbIndex = 2;
|
||||
var cfg = RedisConnection.Split(',').FirstOrDefault(p => p.StartsWith("defaultDatabase=", StringComparison.OrdinalIgnoreCase));
|
||||
if (cfg is not null && int.TryParse(cfg.Split('=')[1], out var parsed))
|
||||
dbIndex = parsed;
|
||||
await server.FlushDatabaseAsync(dbIndex);
|
||||
|
||||
await using (var redis = await ConnectionMultiplexer.ConnectAsync(RedisConnection))
|
||||
{
|
||||
var server = redis.GetServer(redis.GetEndPoints().First());
|
||||
await server.FlushDatabaseAsync(dbIndex);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ConfigureClient(HttpClient client)
|
||||
|
||||
Reference in New Issue
Block a user