Commit 8fc7da4c authored by Jérome Perrin's avatar Jérome Perrin

software/proftpd/test: fix flaky test_partial_upload_are_deleted

There can be a short delay until the partially uploaded file is actually
removed, so wait a little bit before checking for its absence.
parent 2a84c6eb
Pipeline #17748 failed with stage
...@@ -31,6 +31,7 @@ from urllib.parse import urlparse, parse_qs ...@@ -31,6 +31,7 @@ from urllib.parse import urlparse, parse_qs
import tempfile import tempfile
import io import io
import subprocess import subprocess
import time
from http.server import BaseHTTPRequestHandler from http.server import BaseHTTPRequestHandler
import logging import logging
...@@ -152,7 +153,12 @@ class TestSFTPOperations(ProFTPdTestCase): ...@@ -152,7 +153,12 @@ class TestSFTPOperations(ProFTPdTestCase):
with self.assertRaises(IOError): with self.assertRaises(IOError):
sftp.sftp_client.putfo(ErrorFile(), "destination") sftp.sftp_client.putfo(ErrorFile(), "destination")
# no half uploaded file is kept # no half uploaded file is kept
for _ in range(10):
if not os.listdir(self.upload_dir):
break
time.sleep(0.1)
self.assertEqual([], os.listdir(self.upload_dir)) self.assertEqual([], os.listdir(self.upload_dir))
def test_user_cannot_escape_home(self): def test_user_cannot_escape_home(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment