| 542 | } |
| 543 | |
| 544 | func TestMultiReplica_EmptyRelayAddress(t *testing.T) { |
| 545 | t.Parallel() |
| 546 | |
| 547 | ctx := testutil.Context(t, testutil.WaitLong) |
| 548 | db, ps := dbtestutil.NewDB(t) |
| 549 | logger := testutil.Logger(t) |
| 550 | |
| 551 | _, _ = coderdenttest.New(t, &coderdenttest.Options{ |
| 552 | EntitlementsUpdateInterval: 25 * time.Millisecond, |
| 553 | ReplicaSyncUpdateInterval: 25 * time.Millisecond, |
| 554 | Options: &coderdtest.Options{ |
| 555 | Logger: &logger, |
| 556 | Database: db, |
| 557 | Pubsub: ps, |
| 558 | }, |
| 559 | }) |
| 560 | |
| 561 | mgr, err := replicasync.New(ctx, logger, db, ps, &replicasync.Options{ |
| 562 | ID: uuid.New(), |
| 563 | RelayAddress: "", |
| 564 | RegionID: 999, |
| 565 | UpdateInterval: testutil.IntervalFast, |
| 566 | }) |
| 567 | require.NoError(t, err) |
| 568 | defer mgr.Close() |
| 569 | |
| 570 | // Send a bunch of updates to see if the coderd will log errors. |
| 571 | { |
| 572 | ctx, cancel := context.WithTimeout(ctx, testutil.IntervalMedium) |
| 573 | for r := retry.New(testutil.IntervalFast, testutil.IntervalFast); r.Wait(ctx); { |
| 574 | require.NoError(t, mgr.PublishUpdate()) |
| 575 | } |
| 576 | cancel() |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | func TestMultiReplica_EmptyRelayAddress_DisabledDERP(t *testing.T) { |
| 581 | t.Parallel() |