HomePhabricator

[lit, test] Fix test cancellation feature detection

Authored by thopre on Apr 1 2021, 7:02 AM.

Description

[lit, test] Fix test cancellation feature detection

A lit feature guards tests for the lit timeout functionality because on
most system it depends on the availability of the psutil Python module.
However, that feature is defined based on the ability of the testing lit
to cancel test, which does not necessarily apply to the ability of the
tested lit.

In particular, RUN commands have a cleared PYTHONPATH and user site
packages are disabled. In the case where psutil is found by the testing
lit from one of those two source of python path, the tested lit would
not be able to find it, causing timeout tests to fail.

This commit fixes the issue by testing the ability to cancel tests in
the RUN command environment.

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D99728

Details

Committed
thopreApr 20 2021, 4:09 AM
Reviewer
yln
Differential Revision
D99728: [lit, test] Fix test cancellation feature detection
Parents
rG3d4a6037ff46: clang-format: [JS] do not merge imports and exports.
Branches
Unknown
Tags
Unknown