@@ -29,14 +29,13 @@ index f2b4064..cb4e9e8 100644
2929 @override
3030 def get_build_environment(self) -> dict[str, str]:
3131diff --git a/craft_parts/plugins/validator.py b/craft_parts/plugins/validator.py
32- index 5b4c735..8ff30c2 100644
32+ index 5b4c735..d7a446e 100644
3333--- a/craft_parts/plugins/validator.py
3434+++ b/craft_parts/plugins/validator.py
35- @@ -141,9 +141,9 @@ class PluginEnvironmentValidator:
36- print(self._env, file=env_file)
35+ @@ -142,8 +142,9 @@ class PluginEnvironmentValidator:
3736 print(cmd, file=env_file)
3837 env_file.flush()
39- -
38+
4039+ import shutil
4140 proc = subprocess.run(
4241- ["/bin/bash", env_file.name],
@@ -45,7 +44,7 @@ index 5b4c735..8ff30c2 100644
4544 capture_output=True,
4645 text=True,
4746diff --git a/tests/unit/executor/test_step_handler.py b/tests/unit/executor/test_step_handler.py
48- index 4e73c2b..b762fb8 100644
47+ index 4e73c2b..a5f9374 100644
4948--- a/tests/unit/executor/test_step_handler.py
5049+++ b/tests/unit/executor/test_step_handler.py
5150@@ -209,9 +209,10 @@ class TestStepHandlerBuiltins:
@@ -56,21 +55,21 @@ index 4e73c2b..b762fb8 100644
5655 assert file.read() == dedent(
5756 f"""\
5857- #!/bin/bash
59- + #!{shutil.which(' bash' )}
58+ + #!{shutil.which(" bash" )}
6059 set -euo pipefail
6160 source {environment_script_path}
6261 set -x
6362diff --git a/tests/unit/utils/test_process.py b/tests/unit/utils/test_process.py
64- index 84b29ad..dc2d772 100644
63+ index a025494..a76cfa2 100644
6564--- a/tests/unit/utils/test_process.py
6665+++ b/tests/unit/utils/test_process.py
6766@@ -33,7 +33,8 @@ _RUN_TEST_CASES = [
6867
6968 @pytest.mark.parametrize(("out", "err"), _RUN_TEST_CASES)
7069 def test_run(out, err):
71- - result = process.run(["/usr/bin/sh", "-c", f"echo {out};sleep 0;echo {err} >&2"])
70+ - result = process.run(["/usr/bin/sh", "-c", f"echo {out};sleep 0.1 ;echo {err} >&2"])
7271+ import shutil
73- + result = process.run([shutil.which("sh"), "-c", f"echo {out};sleep 0;echo {err} >&2"])
72+ + result = process.run([shutil.which("sh"), "-c", f"echo {out};sleep 0.1 ;echo {err} >&2"])
7473 assert result.returncode == 0
7574 assert result.stdout == (out + "\n").encode()
7675 assert result.stderr == (err + "\n").encode()
@@ -95,5 +94,5 @@ index 84b29ad..dc2d772 100644
9594- "/usr/bin/sh",
9695+ shutil.which("sh"),
9796 "-c",
98- f"echo {out};sleep 0;echo {err} >&2; echo -n {out}|socat - UNIX-CONNECT:{new_dir}/test.socket",
97+ f"echo {out};sleep 0.1 ;echo {err} >&2; echo -n {out}|socat - UNIX-CONNECT:{new_dir}/test.socket",
9998 ],
0 commit comments