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:
Daniel Schadt 2015-11-12 13:17:10 +01:00
parent c759bf7a2f
commit 30e2afb59d
2 changed files with 2 additions and 1 deletions

View File

@ -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):

View File

@ -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)