Skip to content

Commit

Permalink
tests: Do not let LibreOffice hang on the large test set
Browse files Browse the repository at this point in the history
Some of the files in our large test set can make LibreOffice hang. We
do not have a proper solution for this yet, but we can at least make
the tests timeout quickly, so that they can finish at some point.

Refs #878
  • Loading branch information
apyrgio committed Jul 25, 2024
1 parent 7c35f84 commit d41b840
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_large_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ def run_doc_test(self, doc: Path, tmp_path: Path) -> None:
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
out, _ = p.communicate()
try:
# Set a global timeout of 5 minutes for the processing of a document.
# This is hacky way to sidestep https://github.com/freedomofpress/dangerzone/issues/878
out, _ = p.communicate(timeout=5 * 60)
except subprocess.TimeoutExpired:
print(f"*** TIMEOUT EXCEEDED FOR DOCUMENT '{doc}' ***")
from strip_ansi import strip_ansi

print(strip_ansi(out.decode()))
Expand Down

0 comments on commit d41b840

Please sign in to comment.