Skip to content

Commit 32660f1

Browse files
committed
fixup
1 parent 3b79cc0 commit 32660f1

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

enterprise/tailnet/pgcoord_test.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func TestPGCoordinatorSingle_SendsHeartbeats(t *testing.T) {
417417
// TestPGCoordinatorDual_Mainline tests with 2 coordinators, one agent connected to each, and 2 clients per agent.
418418
//
419419
// +---------+
420-
// agent ---> | coord1 | <--- client11 (coord 1, agent 1)
420+
// agent1 ---> | coord1 | <--- client11 (coord 1, agent 1)
421421
// | |
422422
// | | <--- client12 (coord 1, agent 2)
423423
// +---------+
@@ -442,20 +442,20 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
442442
require.NoError(t, err)
443443
defer coord2.Close()
444444

445-
agent := agpltest.NewAgent(ctx, t, coord1, "agent")
446-
defer agent.Close(ctx)
447-
t.Logf("agent=%s", agent.ID)
445+
agent1 := agpltest.NewAgent(ctx, t, coord1, "agent")
446+
defer agent1.Close(ctx)
447+
t.Logf("agent=%s", agent1.ID)
448448
agent2 := agpltest.NewAgent(ctx, t, coord2, "agent2")
449449
defer agent2.Close(ctx)
450450
t.Logf("agent2=%s", agent2.ID)
451451

452-
client11 := agpltest.NewClient(ctx, t, coord1, "client11", agent.ID)
452+
client11 := agpltest.NewClient(ctx, t, coord1, "client11", agent1.ID)
453453
defer client11.Close(ctx)
454454
t.Logf("client11=%s", client11.ID)
455455
client12 := agpltest.NewClient(ctx, t, coord1, "client12", agent2.ID)
456456
defer client12.Close(ctx)
457457
t.Logf("client12=%s", client12.ID)
458-
client21 := agpltest.NewClient(ctx, t, coord2, "client21", agent.ID)
458+
client21 := agpltest.NewClient(ctx, t, coord2, "client21", agent1.ID)
459459
defer client21.Close(ctx)
460460
t.Logf("client21=%s", client21.ID)
461461
client22 := agpltest.NewClient(ctx, t, coord2, "client22", agent2.ID)
@@ -464,11 +464,11 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
464464

465465
t.Logf("client11 -> Node 11")
466466
client11.UpdateDERP(11)
467-
agent.AssertEventuallyHasDERP(client11.ID, 11)
467+
agent1.AssertEventuallyHasDERP(client11.ID, 11)
468468

469469
t.Logf("client21 -> Node 21")
470470
client21.UpdateDERP(21)
471-
agent.AssertEventuallyHasDERP(client21.ID, 21)
471+
agent1.AssertEventuallyHasDERP(client21.ID, 21)
472472

473473
t.Logf("client22 -> Node 22")
474474
client22.UpdateDERP(22)
@@ -484,9 +484,9 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
484484
agent2.AssertEventuallyHasDERP(client12.ID, 12)
485485

486486
t.Logf("agent -> Node 1")
487-
agent.UpdateDERP(1)
488-
client21.AssertEventuallyHasDERP(agent.ID, 1)
489-
client11.AssertEventuallyHasDERP(agent.ID, 1)
487+
agent1.UpdateDERP(1)
488+
client21.AssertEventuallyHasDERP(agent1.ID, 1)
489+
client11.AssertEventuallyHasDERP(agent1.ID, 1)
490490

491491
t.Logf("close coord2")
492492
err = coord2.Close()
@@ -503,10 +503,10 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
503503
err = coord1.Close()
504504
require.NoError(t, err)
505505
// this closes agent, client12, client11
506-
agent.AssertEventuallyResponsesClosed()
506+
agent1.AssertEventuallyResponsesClosed()
507507
client12.AssertEventuallyResponsesClosed()
508508
client11.AssertEventuallyResponsesClosed()
509-
assertEventuallyLost(ctx, t, store, agent.ID)
509+
assertEventuallyLost(ctx, t, store, agent1.ID)
510510
assertEventuallyLost(ctx, t, store, client11.ID)
511511
assertEventuallyLost(ctx, t, store, client12.ID)
512512
}
@@ -516,7 +516,7 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
516516
// or an infrastructure problem where an old workspace is not fully cleaned up before a new one started.
517517
//
518518
// +---------+
519-
// agent ---> | coord1 |
519+
// agent1 ---> | coord1 |
520520
// +---------+
521521
// +---------+
522522
// agent2 ---> | coord2 |
@@ -543,42 +543,42 @@ func TestPGCoordinator_MultiCoordinatorAgent(t *testing.T) {
543543
require.NoError(t, err)
544544
defer coord3.Close()
545545

546-
agent := agpltest.NewAgent(ctx, t, coord1, "agent")
547-
defer agent.Close(ctx)
546+
agent1 := agpltest.NewAgent(ctx, t, coord1, "agent")
547+
defer agent1.Close(ctx)
548548
agent2 := agpltest.NewPeer(ctx, t, coord2, "agent2",
549-
agpltest.WithID(agent.ID), agpltest.WithAuth(agpl.AgentCoordinateeAuth{ID: agent.ID}),
549+
agpltest.WithID(agent1.ID), agpltest.WithAuth(agpl.AgentCoordinateeAuth{ID: agent1.ID}),
550550
)
551551
defer agent2.Close(ctx)
552552

553-
client := agpltest.NewClient(ctx, t, coord3, "client", agent.ID)
553+
client := agpltest.NewClient(ctx, t, coord3, "client", agent1.ID)
554554
defer client.Close(ctx)
555555

556556
client.UpdateDERP(3)
557-
agent.AssertEventuallyHasDERP(client.ID, 3)
557+
agent1.AssertEventuallyHasDERP(client.ID, 3)
558558
agent2.AssertEventuallyHasDERP(client.ID, 3)
559559

560-
agent.UpdateDERP(1)
561-
client.AssertEventuallyHasDERP(agent.ID, 1)
560+
agent1.UpdateDERP(1)
561+
client.AssertEventuallyHasDERP(agent1.ID, 1)
562562

563563
// agent2's update overrides agent because it is newer
564564
agent2.UpdateDERP(2)
565-
client.AssertEventuallyHasDERP(agent.ID, 2)
565+
client.AssertEventuallyHasDERP(agent1.ID, 2)
566566

567567
// agent2 disconnects, and we should revert back to agent
568568
agent2.Close(ctx)
569-
client.AssertEventuallyHasDERP(agent.ID, 1)
569+
client.AssertEventuallyHasDERP(agent1.ID, 1)
570570

571-
agent.UpdateDERP(11)
572-
client.AssertEventuallyHasDERP(agent.ID, 11)
571+
agent1.UpdateDERP(11)
572+
client.AssertEventuallyHasDERP(agent1.ID, 11)
573573

574574
client.UpdateDERP(31)
575-
agent.AssertEventuallyHasDERP(client.ID, 31)
575+
agent1.AssertEventuallyHasDERP(client.ID, 31)
576576

577-
agent.UngracefulDisconnect(ctx)
577+
agent1.UngracefulDisconnect(ctx)
578578
client.UngracefulDisconnect(ctx)
579579

580580
assertEventuallyLost(ctx, t, store, client.ID)
581-
assertEventuallyLost(ctx, t, store, agent.ID)
581+
assertEventuallyLost(ctx, t, store, agent1.ID)
582582
}
583583

584584
func TestPGCoordinator_Unhealthy(t *testing.T) {

0 commit comments

Comments
 (0)