headscale/hscontrol/servertest
Kristoffer Dalby 3d53f97c82 hscontrol/servertest: fix test expectations for eventual consistency
Three corrections to issue tests that had wrong assumptions about
when data becomes available:

1. initial_map_should_include_peer_online_status: use WaitForCondition
   instead of checking the initial netmap. Online status is set by
   Connect() which sends a PeerChange patch after the initial
   RegisterResponse, so it may not be present immediately.

2. disco_key_should_propagate_to_peers: use WaitForCondition. The
   DiscoKey is sent in the first MapRequest (not RegisterRequest),
   so peers may not see it until a subsequent map update.

3. approved_route_without_announcement: invert the test expectation.
   Tailscale uses a strict advertise-then-approve model -- routes are
   only distributed when the node advertises them (Hostinfo.RoutableIPs)
   AND they are approved. An approval without advertisement is a dormant
   pre-approval. The test now asserts the route does NOT appear in
   AllowedIPs, matching upstream Tailscale semantics.

Also fix TestClient.Reconnect to clear the cached netmap and drain
pending updates before re-registering. Without this, WaitForPeers
returned immediately based on the old session's stale data.
2026-03-19 07:05:58 +01:00
..
assertions.go hscontrol/servertest: add policy, route, ephemeral, and content tests 2026-03-19 07:05:58 +01:00
client.go hscontrol/servertest: fix test expectations for eventual consistency 2026-03-19 07:05:58 +01:00
consistency_test.go hscontrol/servertest: add policy, route, ephemeral, and content tests 2026-03-19 07:05:58 +01:00
content_test.go hscontrol/servertest: add policy, route, ephemeral, and content tests 2026-03-19 07:05:58 +01:00
ephemeral_test.go hscontrol/servertest: expand issue tests to 24 scenarios, surface 4 issues 2026-03-19 07:05:58 +01:00
harness.go hscontrol/servertest: add policy, route, ephemeral, and content tests 2026-03-19 07:05:58 +01:00
issues_test.go hscontrol/servertest: fix test expectations for eventual consistency 2026-03-19 07:05:58 +01:00
lifecycle_test.go hscontrol/servertest: expand issue tests to 24 scenarios, surface 4 issues 2026-03-19 07:05:58 +01:00
policy_test.go hscontrol/servertest: add policy, route, ephemeral, and content tests 2026-03-19 07:05:58 +01:00
poll_race_test.go hscontrol/servertest: add race, stress, and poll race tests 2026-03-19 07:05:58 +01:00
race_test.go hscontrol/servertest: add race, stress, and poll race tests 2026-03-19 07:05:58 +01:00
routes_test.go hscontrol/servertest: expand issue tests to 24 scenarios, surface 4 issues 2026-03-19 07:05:58 +01:00
server.go hscontrol/servertest: add control plane lifecycle and consistency tests 2026-03-19 07:05:58 +01:00
stress_test.go hscontrol/servertest: add race, stress, and poll race tests 2026-03-19 07:05:58 +01:00
weather_test.go hscontrol/servertest: add control plane lifecycle and consistency tests 2026-03-19 07:05:58 +01:00