tests/exec: Wait after writing to a file before executing it

Otherwise we might get "text file is busy", or worse no error at all.

Hoping .2 seconds is enough here.
This commit is contained in:
Fabian Homborg 2020-09-26 07:22:17 +02:00
parent e9582c41b2
commit 537b3f6cb1

View File

@ -13,6 +13,8 @@ echo "neg failed: $status"
set -l f (mktemp) set -l f (mktemp)
echo "#!/bin/sh"\r\n"echo foo" > $f echo "#!/bin/sh"\r\n"echo foo" > $f
chmod +x $f chmod +x $f
# Cheesy sleep to avoid "text file is busy"
sleep 0.2
$f $f
#CHECKERR: Failed to execute process '{{.*}}'. Reason: #CHECKERR: Failed to execute process '{{.*}}'. Reason:
#CHECKERR: The file uses windows line endings (\r\n). Run dos2unix or similar to fix it. #CHECKERR: The file uses windows line endings (\r\n). Run dos2unix or similar to fix it.