Skip to content

flake: coderd/telemetry TestPrebuiltWorkspacesTelemetry/experiment_disabled #676

Open
@sreya

Description

@sreya

Seems like there's a data race:

=== Failed
=== FAIL: coderd/telemetry TestPrebuiltWorkspacesTelemetry/experiment_enabled,_prebuilds_not_used (0.01s)
    t.go:106: 2025-05-30 14:23:05.805 [debu]  finished telemetry status check
    t.go:106: 2025-05-30 14:23:05.808 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.809 [debu]  submitted snapshot
    t.go:106: 2025-05-30 14:23:05.812 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.813 [debu]  submitted snapshot
    testing.go:1490: race detected during execution of test

=== FAIL: coderd/telemetry TestRecordTelemetryStatus (0.00s)
    testing.go:1490: race detected during execution of test
--- PASS: TestRecordTelemetryStatus/New_deployment (0.00s)
--- PASS: TestRecordTelemetryStatus/Telemetry_disabled (0.00s)
--- PASS: TestRecordTelemetryStatus/Telemetry_was_enabled_and_still_is (0.00s)
--- PASS: TestRecordTelemetryStatus/Telemetry_was_enabled_but_now_disabled (0.00s)
--- PASS: TestRecordTelemetryStatus/Telemetry_was_disabled_now_is_enabled (0.00s)
--- PASS: TestRecordTelemetryStatus/Telemetry_was_disabled_still_disabled (0.00s)
    t.go:106: 2025-05-30 14:23:05.813 [debu]  parse telemetry enabled  error="strconv.ParseBool: parsing \"invalid\": invalid syntax"
--- PASS: TestRecordTelemetryStatus/Telemetry_was_disabled_still_disabled,_invalid_value (0.00s)

=== FAIL: coderd/telemetry TestPrebuiltWorkspacesTelemetry/experiment_enabled (0.01s)
    t.go:106: 2025-05-30 14:23:05.807 [debu]  finished telemetry status check
    t.go:106: 2025-05-30 14:23:05.810 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.811 [debu]  submitted snapshot
    t.go:106: 2025-05-30 14:23:05.813 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.814 [debu]  submitted snapshot
    testing.go:1490: race detected during execution of test

=== FAIL: coderd/telemetry TestPrebuiltWorkspacesTelemetry/experiment_disabled (0.01s)
==================
WARNING: DATA RACE
Write at 0x00c000a94790 by goroutine 439:
  github.com/coder/coder/v2/coderd/database/dbmem.(*FakeQuerier).UpsertTelemetryItem()
      /home/runner/work/coder/coder/coderd/database/dbmem/dbmem.go:12443 +0x37d
  github.com/coder/coder/v2/coderd/telemetry_test.(*mockDB).UpsertTelemetryItem()
      <autogenerated>:1 +0xa3
  github.com/coder/coder/v2/coderd/telemetry.RecordTelemetryStatus()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:216 +0x3fb
  github.com/coder/coder/v2/coderd/telemetry.(*remoteReporter).runSnapshotter()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:242 +0x138
  github.com/coder/coder/v2/coderd/telemetry.New.gowrap1()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:90 +0x33

Previous read at 0x00c000a94790 by goroutine 436:
  github.com/coder/coder/v2/coderd/telemetry.(*remoteReporter).createSnapshot.func21()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:683 +0x236
  golang.org/x/sync/errgroup.(*Group).add.func1()
      /home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:130 +0x141

Goroutine 439 (running) created at:
  github.com/coder/coder/v2/coderd/telemetry.New()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:90 +0x533
  github.com/coder/coder/v2/coderd/telemetry_test.collectSnapshot()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry_test.go:609 +0x3e4
  github.com/coder/coder/v2/coderd/telemetry_test.TestPrebuiltWorkspacesTelemetry.func4()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry_test.go:418 +0x14b
  testing.tRunner()
      /opt/hostedtoolcache/go/1.24.2/x64/src/testing/testing.go:1792 +0x225
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.24.2/x64/src/testing/testing.go:1851 +0x44

Goroutine 436 (finished) created at:
  golang.org/x/sync/errgroup.(*Group).add()
      /home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:98 +0xe4
  golang.org/x/sync/errgroup.(*Group).Go()
      /home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x1ec5
  github.com/coder/coder/v2/coderd/telemetry.(*remoteReporter).createSnapshot()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:[677](https://github.com/coder/coder/actions/runs/15348460078/job/43191633638#step:8:678) +0x1d8d
  github.com/coder/coder/v2/coderd/telemetry.(*remoteReporter).reportWithDeployment()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:287 +0x1e5
  github.com/coder/coder/v2/coderd/telemetry.(*remoteReporter).runSnapshotter()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:272 +0x454
  github.com/coder/coder/v2/coderd/telemetry.New.gowrap1()
      /home/runner/work/coder/coder/coderd/telemetry/telemetry.go:90 +0x33
==================
==================
    testing.go:1490: race detected during execution of test

=== FAIL: coderd/telemetry TestPrebuiltWorkspacesTelemetry (0.00s)

=== FAIL: coderd/telemetry TestTelemetry/IDPOrgSync (0.03s)
    t.go:106: 2025-05-30 14:23:05.795 [debu]  finished telemetry status check
    t.go:106: 2025-05-30 14:23:05.799 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.800 [debu]  submitted snapshot
    t.go:106: 2025-05-30 14:23:05.800 [debu]  finished telemetry status check
    t.go:106: 2025-05-30 14:23:05.804 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.805 [debu]  submitted snapshot
    t.go:106: 2025-05-30 14:23:05.805 [debu]  finished telemetry status check
    t.go:106: 2025-05-30 14:23:05.809 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.810 [debu]  submitted snapshot
    t.go:106: 2025-05-30 14:23:05.812 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.813 [debu]  submitted snapshot
    t.go:106: 2025-05-30 14:23:05.816 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.817 [debu]  submitted snapshot
    t.go:106: 2025-05-30 14:23:05.820 [debu]  submitted deployment info
    t.go:106: 2025-05-30 14:23:05.820 [debu]  submitted snapshot
    testing.go:1490: race detected during execution of test

=== FAIL: coderd/telemetry TestTelemetry (0.00s)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions