mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 01:17:45 +00:00
tests/noshebang: Sleep before executing a file we just wrote to
When you try to execute a file directly after you've written to it,
you might, on some systems, get a "text file busy" error.
So we unfortunately have to sleep to avoid it.
See #8021 for where this was added,
537b3f6cb1
for the same problem.
This commit is contained in:
parent
34ededa644
commit
7511de8d8d
1 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,7 @@ end
|
|||
|
||||
# Empty executable files are 'true'.
|
||||
true >file
|
||||
sleep 0.1
|
||||
runfile
|
||||
#CHECK: 0
|
||||
#CHECK: 0
|
||||
|
@ -36,6 +37,7 @@ runfile
|
|||
|
||||
# Never implicitly pass files ending with .fish to /bin/sh.
|
||||
true >file.fish
|
||||
sleep 0.1
|
||||
chmod a+x file.fish
|
||||
set -g fish_use_posix_spawn 0
|
||||
./file.fish
|
||||
|
@ -58,12 +60,14 @@ rm file.fish
|
|||
# On to NUL bytes.
|
||||
# The heuristic is that there must be a line containing a lowercase letter before the first NUL byte.
|
||||
echo -n -e 'true\n\x00' >file
|
||||
sleep 0.1
|
||||
runfile
|
||||
#CHECK: 0
|
||||
#CHECK: 0
|
||||
|
||||
# Doesn't meet our heuristic as there is no newline.
|
||||
echo -n -e 'true\x00' >file
|
||||
sleep 0.1
|
||||
runfile
|
||||
#CHECK: 126
|
||||
#CHECKERR: Failed {{.*}}
|
||||
|
@ -77,6 +81,7 @@ runfile
|
|||
|
||||
# Doesn't meet our heuristic as there is no lowercase before newline.
|
||||
echo -n -e 'NOPE\n\x00' >file
|
||||
sleep 0.1
|
||||
runfile
|
||||
#CHECK: 126
|
||||
#CHECKERR: Failed {{.*}}
|
||||
|
|
Loading…
Reference in a new issue