Skip to content

flake: data race in TestConcurrentFetch #950

@spikecurtis

Description

@spikecurtis
=== Failed
=== FAIL: coderd/files TestCancelledConcurrentFetch (0.00s)
==================
WARNING: DATA RACE
Write at 0x00c000c26158 by goroutine 61:
  runtime.racewrite()
      <autogenerated>:1 +0x1e
  github.com/coder/coder/v2/coderd/files_test.TestConcurrentFetch.func2()
      /home/runner/work/coder/coder/coderd/files/cache_test.go:115 +0x104

Previous read at 0x00c000c26158 by goroutine 30:
  runtime.raceread()
      <autogenerated>:1 +0x1e
  github.com/coder/coder/v2/coderd/files_test.TestConcurrentFetch()
      /home/runner/work/coder/coder/coderd/files/cache_test.go:109 +0x712
  testing.tRunner()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:1792 +0x225
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:1851 +0x44

Goroutine 61 (running) created at:
  github.com/coder/coder/v2/coderd/files_test.TestConcurrentFetch()
      /home/runner/work/coder/coder/coderd/files/cache_test.go:112 +0x6db
  testing.tRunner()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:1792 +0x225
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:1851 +0x44

Goroutine 30 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:1851 +0x8f2
  testing.runTests.func1()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:2279 +0x85
  testing.tRunner()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:1792 +0x225
  testing.runTests()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:2277 +0x96c
  testing.(*M).Run()
      /opt/hostedtoolcache/go/1.24.6/x64/src/testing/testing.go:2142 +0xeea
  main.main()
      _testmain.go:59 +0x164
==================
    testing.go:1490: race detected during execution of test

=== FAIL: coderd/files TestConcurrentFetch (0.00s)
    testing.go:1490: race detected during execution of test

Seen here: https://github.com/coder/coder/actions/runs/17296221039/job/49094997590

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions