Skip to content

Support Bazel TEST_PREMATURE_EXIT_FILE #3020

@mattyclarkson

Description

@mattyclarkson

Description

When running bazel test it creates the TEST_PREMATURE_EXIT_FILE which contains an absolute path to a file in a writable directory.

If a test binary creates that file, then removes it on a successful exit it allows the test runner to understand when a test binary has been aggressively aborted.

Additional Context

In order to catch early exit, a test may create a file at the path specified by TEST_PREMATURE_EXIT_FILE upon start and remove it upon exit. If Bazel sees the file when the test finishes, it will assume that the test exited prematurely and mark it as having failed.

Bazel test encyclopedia

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions