fix(external-system-gateway): resolve ExternalSystemGateway-015..017 — treat MaxRetries=0 as unset, scope HTTP connection cap to gateway clients, no bare trailing '?'
This commit is contained in:
@@ -113,8 +113,13 @@ public class DatabaseGatewayTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CachedWrite_ZeroMaxRetriesIsHonouredNotTreatedAsUnset()
|
||||
public async Task CachedWrite_ZeroMaxRetriesIsTreatedAsUnsetNotRetryForever()
|
||||
{
|
||||
// ExternalSystemGateway-015: a stored MaxRetries of 0 is interpreted by the
|
||||
// Store-and-Forward retry sweep as "no limit" (retry forever). The entity's
|
||||
// non-nullable int default is also 0, so the gateway must treat the
|
||||
// connection's MaxRetries == 0 as "unset" and pass null — the bounded S&F
|
||||
// default must apply, never 0.
|
||||
var conn = new DatabaseConnectionDefinition("testDb", "Server=localhost;Database=test")
|
||||
{
|
||||
Id = 1,
|
||||
@@ -144,7 +149,9 @@ public class DatabaseGatewayTests
|
||||
await gateway.CachedWriteAsync("testDb", "INSERT INTO t VALUES (1)");
|
||||
|
||||
var (maxRetries, _) = ReadBufferedRetrySettings(connStr);
|
||||
Assert.Equal(0, maxRetries); // honoured — not the S&F default of 99
|
||||
// Must be the bounded S&F default, never 0 — a stored 0 would mean retry-forever.
|
||||
Assert.Equal(99, maxRetries);
|
||||
Assert.NotEqual(0, maxRetries);
|
||||
}
|
||||
|
||||
private static (int MaxRetries, long RetryIntervalMs) ReadBufferedRetrySettings(string connStr)
|
||||
|
||||
Reference in New Issue
Block a user