mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-26 16:04:06 +00:00
Fix test hanging reading FIFO when borg create
failed
This commit is contained in:
parent
f25f6a8e33
commit
8ce3d22358
1 changed files with 6 additions and 0 deletions
|
@ -784,6 +784,12 @@ def fifo_feeder(fifo_fn, data):
|
||||||
try:
|
try:
|
||||||
self.cmd(f"--repo={self.repository_location}", "create", "--read-special", "test", "input/link_fifo")
|
self.cmd(f"--repo={self.repository_location}", "create", "--read-special", "test", "input/link_fifo")
|
||||||
finally:
|
finally:
|
||||||
|
# In case `borg create` failed to open FIFO, read all data to avoid join() hanging.
|
||||||
|
fd = os.open(fifo_fn, os.O_RDONLY | os.O_NONBLOCK)
|
||||||
|
try:
|
||||||
|
os.read(fd, len(data))
|
||||||
|
finally:
|
||||||
|
os.close(fd)
|
||||||
t.join()
|
t.join()
|
||||||
with changedir("output"):
|
with changedir("output"):
|
||||||
self.cmd(f"--repo={self.repository_location}", "extract", "test")
|
self.cmd(f"--repo={self.repository_location}", "extract", "test")
|
||||||
|
|
Loading…
Reference in a new issue