routes: add property test for PrimaryRoutes algorithm

Generate randomised sequences of ConnectAdvertise, Disconnect,
ProbeUnhealthy, ProbeHealthy and ApprovedRoutesChange operations
with rapid and check the per-prefix primary chosen by the
implementation matches a reference model after every step.

Used to broaden the search for #3203 beyond hand-enumerated
disconnect/reconnect sequences. Algorithm passes 5000 checks;
kept as a safety net for future changes to primary route
selection.

Updates #3203
This commit is contained in:
Kristoffer Dalby
2026-04-28 12:16:34 +00:00
parent 2e1a716a9a
commit 3eefe3c2cc
3 changed files with 316 additions and 1 deletions
+1
View File
@@ -54,6 +54,7 @@ require (
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/postgres v1.6.0
gorm.io/gorm v1.31.1
pgregory.net/rapid v1.2.0
tailscale.com v1.96.5
zombiezen.com/go/postgrestest v1.0.1
)