fix(nodes): locate agents behind a proxy and retry missing countries [CI]
This commit is contained in:
1 parent
1145a53004
commit
0d532caf08
13 files changed
+93
-15
No files matched your search
@@ -102,6 +102,24 @@ public sealed partial class NodeInfoTests
|
||||
Assert.Null(Assert.Single(await service.ListAsync(CancellationToken.None)).Country);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Service_AnUnlocatedNode_IsRetriedFromTheHeartbeat_UntilItHasACountry()
|
||||
{
|
||||
var time = new FakeTimeProvider(DateTimeOffset.Parse("2026-10-06T00:00:00Z"));
|
||||
var service = new NodeInfoService(new MemoryStore(), new FakeGeo(null), time);
|
||||
|
||||
Assert.True(service.ShouldRetryGeo("agt_1"));
|
||||
await service.ObserveAddressAsync("agt_1", NodeKinds.Agent, "", CancellationToken.None);
|
||||
Assert.False(service.ShouldRetryGeo("agt_1"));
|
||||
time.Advance(TimeSpan.FromMinutes(11));
|
||||
Assert.True(service.ShouldRetryGeo("agt_1"));
|
||||
|
||||
var found = new NodeInfoService(new MemoryStore(), new FakeGeo(new GeoInfo("jp", 1, "Example", false)), time);
|
||||
await found.ObserveAddressAsync("agt_2", NodeKinds.Agent, "8.8.8.8", CancellationToken.None);
|
||||
time.Advance(TimeSpan.FromMinutes(11));
|
||||
Assert.False(found.ShouldRetryGeo("agt_2"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Service_PlatformIsSavedAndSurvivesARestart()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user