Skip to content

Symlink race conditions in test executables under dune --force #18755

@dkijania

Description

@dkijania

Summary

When running dune runtest --force (used for coverage builds to ensure full recompilation), several test executables hit symlink race conditions during parallel execution.

Failure Details

Affected executables:

  • test_range_check.exe
  • test_step.exe
  • test_plonk_curve_ops.exe

Error: Unix.Unix_error "File exists" symlink

Observed in: Nightly build #1268 on branch dkijania/force-coverage-on-nightly

Log excerpt

test_range_check.exe: internal error, uncaught exception:
                      (Unix.Unix_error "File exists" symlink
test_step.exe: internal error, uncaught exception:
               (Unix.Unix_error "File exists" symlink
test_plonk_curve_ops.exe: internal error, uncaught exception:
                          (Sys_error

Context

The --force flag was added in PR #18751 to ensure bisect_ppx generates .coverage files for all source files during nightly builds. Without --force, dune's incremental compilation skips unchanged files, leading to incomplete coverage.

The symlink collisions occur because --force causes all targets to rebuild in parallel, and these test executables create symlinks that race with each other.

Impact

  • These appear to be warnings/crashes of individual test processes, not test failures that block CI
  • The affected tests (pickles-related) may still pass on retry since dune retries failed tests

Suggested Fix

  • Investigate which symlinks are being created and whether they can use unique names or atomic operations
  • Alternatively, clean the _build directory before --force runs to avoid stale symlinks
  • Consider if dune clean before runtest --force is cheaper than debugging the race

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions