MCPcopy Index your code
hub / github.com/coder/coder / TestMultiReplica_EmptyRelayAddress

Function TestMultiReplica_EmptyRelayAddress

enterprise/coderd/coderd_test.go:544–578  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

542}
543
544func 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
580func TestMultiReplica_EmptyRelayAddress_DisabledDERP(t *testing.T) {
581 t.Parallel()

Callers

nothing calls this directly

Calls 9

ContextFunction · 0.92
NewDBFunction · 0.92
LoggerFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
PublishUpdateMethod · 0.80
NewMethod · 0.65
CloseMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected