You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I faced a scenario where my test was stuck, and after a Ctrl+C I noticed it was happening because the rm command in temp_del was waiting for user's input.
I'm wondering if we should use rm -rf here (which probably requires extra care).
Using --interactive=never would be The Perfect™ solution, but I'm afraid it's not portable (GNU coreutils only).
Expected behavior
Given the fact that temp_del is supposed to be used programatically (never in an interactive session), it should never wait for user's input (it should either succeed or fail).
$ bats sample.bats
sample.bats
temp_del waits for user input # 👈 Hit Ctrl+C
✗ temp_del waits for user input
(from function `temp_del' in file test/test_helper/bats-file/src/temp.bash, line 1,
from function `teardown' in test file sample.bats, line 11)
`temp_del "${TEST_TEMP_DIR}"' failed
-- ERROR: temp_del --
rm: remove write-protected directory '/tmp/sample.bats-1-YgMpb7/my_dir'?
--
Received SIGINT, aborting ...
1 test, 1 failure
The text was updated successfully, but these errors were encountered:
Issue
I faced a scenario where my test was stuck, and after a
Ctrl+C
I noticed it was happening because therm
command intemp_del
was waiting for user's input.Specifically this line:
bats-file/src/temp.bash
Line 174 in c0e3a26
I'm wondering if we should use
rm -rf
here (which probably requires extra care).Using
--interactive=never
would be The Perfect™ solution, but I'm afraid it's not portable (GNU coreutils only).Expected behavior
Given the fact that
temp_del
is supposed to be used programatically (never in an interactive session), it should never wait for user's input (it should either succeed or fail).Steps to reproduce
Start a dummy project:
mkdir -p deleteme/test cd deleteme git init git submodule add \ https://github.com/bats-core/bats-file.git \ test/test_helper/bats-file git submodule add \ https://github.com/bats-core/bats-support.git \ test/test_helper/bats-support
Create a
sample.bats
like this:Run the test and see it getting stuck.
The text was updated successfully, but these errors were encountered: