mhtml: reduce test flakiness
Waiting for "All assets downloaded" may lead to race conditions when the output file is read before qute wrote it, so the test fails.
This commit is contained in:
parent
c759bf7a2f
commit
30e2afb59d
@ -436,6 +436,7 @@ class _Downloader():
|
||||
self.writer.write_to(file_output)
|
||||
finally:
|
||||
file_output.close()
|
||||
log.downloads.debug("File successfully written.")
|
||||
message.info(self._win_id, "Page saved as {}".format(self.dest))
|
||||
|
||||
def collect_zombies(self):
|
||||
|
@ -86,7 +86,7 @@ def test_mhtml(test_name, download_dir, quteproc, httpbin):
|
||||
quteproc.send_cmd(':download --mhtml --dest "{}"'.format(download_dest))
|
||||
quteproc.wait_for(category='downloads', module='mhtml',
|
||||
function='finish_file',
|
||||
message='All assets downloaded, ready to finish off!')
|
||||
message='File successfully written.')
|
||||
|
||||
expected_file = os.path.join(test_dir, '{}.mht'.format(test_name))
|
||||
download_dir.compare_mhtml(expected_file)
|
||||
|
Loading…
Reference in New Issue
Block a user