Skip to content

Commit 84a6d82

Browse files
committed
fixup
1 parent 32660f1 commit 84a6d82

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

coderd/tailnet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func NewServerTailnet(
7676
// given in this callback, it's only valid while connecting.
7777
if derpServer != nil {
7878
conn.SetDERPRegionDialer(func(_ context.Context, region *tailcfg.DERPRegion) net.Conn {
79+
// Don't set up the embedded relay if we're shutting down
7980
if !region.EmbeddedRelay || ctx.Err() != nil {
8081
return nil
8182
}

enterprise/tailnet/pgcoord_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,9 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
442442
require.NoError(t, err)
443443
defer coord2.Close()
444444

445-
agent1 := agpltest.NewAgent(ctx, t, coord1, "agent")
445+
agent1 := agpltest.NewAgent(ctx, t, coord1, "agent1")
446446
defer agent1.Close(ctx)
447-
t.Logf("agent=%s", agent1.ID)
447+
t.Logf("agent1=%s", agent1.ID)
448448
agent2 := agpltest.NewAgent(ctx, t, coord2, "agent2")
449449
defer agent2.Close(ctx)
450450
t.Logf("agent2=%s", agent2.ID)
@@ -483,7 +483,7 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
483483
client12.UpdateDERP(12)
484484
agent2.AssertEventuallyHasDERP(client12.ID, 12)
485485

486-
t.Logf("agent -> Node 1")
486+
t.Logf("agent1 -> Node 1")
487487
agent1.UpdateDERP(1)
488488
client21.AssertEventuallyHasDERP(agent1.ID, 1)
489489
client11.AssertEventuallyHasDERP(agent1.ID, 1)
@@ -502,7 +502,7 @@ func TestPGCoordinatorDual_Mainline(t *testing.T) {
502502

503503
err = coord1.Close()
504504
require.NoError(t, err)
505-
// this closes agent, client12, client11
505+
// this closes agent1, client12, client11
506506
agent1.AssertEventuallyResponsesClosed()
507507
client12.AssertEventuallyResponsesClosed()
508508
client11.AssertEventuallyResponsesClosed()
@@ -543,7 +543,7 @@ func TestPGCoordinator_MultiCoordinatorAgent(t *testing.T) {
543543
require.NoError(t, err)
544544
defer coord3.Close()
545545

546-
agent1 := agpltest.NewAgent(ctx, t, coord1, "agent")
546+
agent1 := agpltest.NewAgent(ctx, t, coord1, "agent1")
547547
defer agent1.Close(ctx)
548548
agent2 := agpltest.NewPeer(ctx, t, coord2, "agent2",
549549
agpltest.WithID(agent1.ID), agpltest.WithAuth(agpl.AgentCoordinateeAuth{ID: agent1.ID}),
@@ -560,11 +560,11 @@ func TestPGCoordinator_MultiCoordinatorAgent(t *testing.T) {
560560
agent1.UpdateDERP(1)
561561
client.AssertEventuallyHasDERP(agent1.ID, 1)
562562

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

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

@@ -625,8 +625,8 @@ func TestPGCoordinator_Unhealthy(t *testing.T) {
625625
err := uut.Close()
626626
require.NoError(t, err)
627627
}()
628-
agent := agpltest.NewAgent(ctx, t, uut, "agent")
629-
defer agent.Close(ctx)
628+
agent1 := agpltest.NewAgent(ctx, t, uut, "agent1")
629+
defer agent1.Close(ctx)
630630
for i := 0; i < 3; i++ {
631631
select {
632632
case <-ctx.Done():
@@ -636,7 +636,7 @@ func TestPGCoordinator_Unhealthy(t *testing.T) {
636636
}
637637
}
638638
// connected agent should be disconnected
639-
agent.AssertEventuallyResponsesClosed()
639+
agent1.AssertEventuallyResponsesClosed()
640640

641641
// new agent should immediately disconnect
642642
agent2 := agpltest.NewAgent(ctx, t, uut, "agent2")

0 commit comments

Comments
 (0)