Skip to content

Commit

Permalink
test: fix race when opening file
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Jul 29, 2021
1 parent c25c60e commit cbb4594
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/fedora-installs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,12 @@ touch merged/$(printf %${merged_max_filename_len}s | tr ' ' A})

# If a file is removed but referenced, we must still be able to access it.
echo 12345 | tee merged/toremove
cat merged/toremove
sleep 90 < merged/toremove &
exec 3<> merged/toremove
sleep 90 &
exec 3>&-
sleep_pid=$!
rm merged/toremove
grep 12345 /proc/$sleep_pid/fd/0
grep 12345 /proc/$sleep_pid/fd/3

touch merged/a merged/b
chmod 6 merged/a
Expand Down

0 comments on commit cbb4594

Please sign in to comment.