Skip to content

Flaky test: TestDAGExecutor_ComplexWorkflow fails intermittently with race detector #2613

@JAORMX

Description

@JAORMX

Description

The test TestDAGExecutor_ComplexWorkflow in pkg/vmcp/composer/dag_executor_test.go fails intermittently when run with the race detector (-race flag).

Reproduction

# Fails intermittently
go test ./pkg/vmcp/composer -race -v -run TestDAGExecutor_ComplexWorkflow

# Passes consistently without race detector
go test ./pkg/vmcp/composer -v -run TestDAGExecutor_ComplexWorkflow

Symptoms

  • Test passes consistently without -race flag
  • Test fails occasionally with -race flag
  • Failure appears to be timing-related due to race detector instrumentation overhead

Root Cause

The test exercises parallel step execution in the DAG executor, making it sensitive to timing variations introduced by the race detector's instrumentation. This suggests potential timing assumptions in the test rather than actual race conditions.

Impact

  • Low priority: Test passes without race detector
  • Not blocking development work
  • May indicate test needs more robust timing handling

Suggested Fix

Options to investigate:

  1. Add retry logic or more generous timeouts for race detector runs
  2. Use synchronization primitives to make timing more deterministic
  3. Restructure test to avoid timing dependencies
  4. Add t.Parallel() handling if not already present

Related

Discovered while testing PR #2612 (unrelated changes to remove StepTypeConditional)

Environment

  • Go version: (current)
  • Test command: go test ./pkg/vmcp/composer -race -v

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggoPull requests that update go codep2Low

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions