diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index deb1c1a..0840819 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -18,7 +18,7 @@ jobs: os: [ubuntu-20.04, ubuntu-22.04] fail-fast: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Package run: | python -m pip install virtualenv @@ -33,4 +33,4 @@ jobs: - name: Test with pytest run: | source ve/bin/activate - make test + pytest -s diff --git a/src/unoserver/server.py b/src/unoserver/server.py index 35dfa17..155a229 100644 --- a/src/unoserver/server.py +++ b/src/unoserver/server.py @@ -97,7 +97,9 @@ def signal_handler(signum, frame): raise if self.xmlrcp_server is not None: + logger.error("A") self.stop() # Ensure the server stops + logger.error("B") signal.signal(signal.SIGTERM, signal_handler) signal.signal(signal.SIGINT, signal_handler) @@ -115,7 +117,9 @@ def signal_handler(signum, frame): # Check if it succeeded if not self.xmlrcp_thread.is_alive(): logger.info("Failed to start servers") + logger.error("C") self.stop() + logger.error("D") return None return self.libreoffice_process @@ -304,7 +308,11 @@ def main(): logger.error(f"Looks like LibreOffice died. PID: {pid}") # The RPC thread needs to be stopped before the process can exit + logger.error("E") server.stop() + logger.error("F") + + logger.error("OK?") if args.libreoffice_pid_file: # Remove the PID file @@ -312,15 +320,19 @@ def main(): try: # Make sure it's really dead + logger.error("Hmm?") os.kill(pid, 0) + logger.error("OK!") if server.intentional_exit: return 0 else: + logger.error("NO!") return 1 except OSError as e: if e.errno == 3: # All good, it was already dead. + logger.error("Yes") return 0 raise diff --git a/tests/test_integration.py b/tests/test_integration.py index de13b7d..099950a 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -107,7 +107,7 @@ def test_multiple_servers(server_fixture): # Now kill the process process.terminate() # Wait for it to terminate - process.wait() + process.wait(10) # And verify that it was killed assert process.returncode == 0 @@ -222,7 +222,7 @@ def test_convert_not_local(): # Now kill the process process.terminate() # Wait for it to terminate - process.wait() + process.wait(timeout=10) # And verify that it was killed assert process.returncode == 0 @@ -262,6 +262,6 @@ def skip_test_compare_not_local(): # Now kill the process process.terminate() # Wait for it to terminate - process.wait() + process.wait(10) # And verify that it was killed assert process.returncode == 0