Thanks to visit codestin.com
Credit goes to github.com

Skip to content

flake: Data race in coderd/x/chatd - TestWaitAgentNonComputerUseNoRecording #1450

Description

@flake-investigator

CI Failure Information

Failure Details

  • Package: coderd/x/chatd
  • Primary failing test: TestWaitAgentNonComputerUseNoRecording
  • Additional failures in same package: TestSubscribeNoPubsubNoDuplicateMessageParts, TestWaitAgentComputerUseRecording, TestWaitAgentNonComputerUseNoRecording, plus multiple chatd unit tests that failed after the race detector fired.

Race detector evidence:

WARNING: DATA RACE
Write at 0x00c003c274b8 by goroutine 105:
  github.com/coder/coder/v2/coderd/x/chatd.TestWaitAgentNonComputerUseNoRecording()
      /home/runner/work/coder/coder/coderd/x/chatd/recording_internal_test.go:225 +0x5f8
  github.com/coder/coder/v2/coderd/x/chatd.createParentChildChats()
      /home/runner/work/coder/coder/coderd/x/chatd/subagent_internal_test.go:780 +0x2db

Previous read at 0x00c003c274b8 by goroutine 15002:
  github.com/coder/coder/v2/coderd/x/chatd.(*Server).processOnce()
      /home/runner/work/coder/coder/coderd/x/chatd/chatd.go:2517 +0x8ee

testing.go:1617: race detected during execution of test

Root Cause Analysis

  • Go race detector flagged a data race in coderd/x/chatd during wait_agent recording tests.
  • The race is between the test path (TestWaitAgentNonComputerUseNoRecording) and chatd server processing (Server.processOnce).
  • The race causes the test-go-race-pg job to fail with multiple chatd test failures after the first race is detected.

Assignment Analysis

  • git log --oneline --follow coderd/x/chatd/recording_internal_test.go
    • 17dec2a7 (Hugo Dutka) — added/updated the wait_agent recording tests.
  • The race is detected inside TestWaitAgentNonComputerUseNoRecording in this file, so assigning to the most recent substantive author: @hugodutka.

Related Issues

  • No matching issues found in coder/internal after searching:
    • TestWaitAgentNonComputerUseNoRecording
    • WARNING: DATA RACE + chatd
    • race detected during execution of test + chatd

Reproduction

go test ./coderd/x/chatd -run TestWaitAgentNonComputerUseNoRecording -race -count=1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions