flux-core icon indicating copy to clipboard operation
flux-core copied to clipboard

testsuite: ensure tests can survive user environment changes

Open chu11 opened this issue 1 year ago • 1 comments

in PR #5576, a fix is proposed to handle a unique scenario where LC_ALL exists in the primary flux instance for testing (set via sharness.sh) but it disappears when flux proxy issues a command to a subinstance. This is presumed to be due to some environment issue with login shells in the user environment.

Generally speaking, tests can be fragile if login shell setup can muck with the expected environment needed for a test.

Currently, this potential probably appears limited so workarounds are ok for the time being. But longer out a solution could be needed if it keeps on becoming a problem.

A naive approach to fix this would be to have some script, say fluxtest.sh that would be a wrapper for the real test when a login shell has the chance to be launched. i.e.

flux proxy $id fluxtest.sh <the command you actually want to run>

and fluxtest.sh could setup the environment as needed.

chu11 avatar Nov 21 '23 06:11 chu11