test(e2e-lb): resolve peer availability before shared fixture setup

setupSharedFixture builds a VPC + 2 app VMs + probe client (minutes
on capacity-tight dev hosts) and previously ran BEFORE the peer
pickup + ssh.Ping. On single-node, the InternetFacing_* subtests
would correctly t.Skip on peer == "" — but only after the fixture
work and once subtests started, so the wait appeared to be attached
to the first subtest name gotestsum printed.

Reorder: pickPeer + ssh.Ping first, log "internet-facing will skip"
immediately, then build the fixture for the internal subtests.
No behavior change for multi-node + peer-reachable; on single-node
the skip rationale surfaces before the fixture wait.
This commit is contained in:
joshsiv-mulga
2026-05-18 23:01:00 +10:00
parent afaf3fe8da
commit 760acd1eb4
+12 -4
View File
@@ -55,11 +55,12 @@ const (
func TestLoadBalancer(t *testing.T) {
env := harness.LoadEnv(t)
skipIfDevNetworking(t, env)
artifacts := harness.ArtifactDir(t, env)
client := harness.NewAWSClient(t, env)
fixture := setupSharedFixture(t, client, artifacts)
// Resolve peer availability BEFORE the shared fixture build (VPC + 2
// app VMs + probe client = minutes). Single-node mode has no peer, so
// the user sees the "internet-facing will skip" message immediately
// instead of attributing the fixture-setup wait to the first subtest
// name that gotestsum prints once subtests start.
peer := pickPeer(env)
var ssh *harness.PeerSSH
if peer != "" {
@@ -72,6 +73,13 @@ func TestLoadBalancer(t *testing.T) {
ssh = nil
}
}
if peer == "" {
t.Logf("no peer node available — internet-facing subtests will skip; building shared fixture for internal subtests")
}
artifacts := harness.ArtifactDir(t, env)
client := harness.NewAWSClient(t, env)
fixture := setupSharedFixture(t, client, artifacts)
t.Run("InternetFacing_ALB", func(t *testing.T) {
if peer == "" {