Skip to content

test: render_update_json_installs_the_suppression_guard_around_resolution mutates process PATH, racing tar-spawning tests #650

Open

Description

@rominf

apps/rocm/src/therock.rs render_update_json_installs_the_suppression_guard_around_resolution sets the process-wide PATH to a single temp directory (std::env::set_var("PATH", &bin_dir)) under PROCESS_ENV_TEST_LOCK. Tests that spawn tar don't take that lock. So under cargo test -p rocm --bin rocm (one process, many threads) they can intermittently fail with failed to launch tar: No such file or directory.

It was seen locally in therock::archive_properties::sdk_tarball_unpack_extracts_a_benign_tarball_into_the_install_root, which passes alone and on re-run. CI's Linux nextest runs one process per test, so it hides this. The Windows lane and the coverage job use cargo test, so they can hit it.

The fix #253 made for the Python-resolver tests applies here too: pass the environment into the code under test as a value instead of mutating the process PATH.

Found while fixing the related fake-executable race in #649.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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