Skip to content

Commit

Permalink
More test output
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennart Regebro committed Oct 8, 2024
1 parent 7b5924b commit 8d2cd5f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,4 +33,4 @@ jobs:
- name: Test with pytest
run: |
source ve/bin/activate
make test
pytest -s
12 changes: 12 additions & 0 deletions src/unoserver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -304,23 +308,31 @@ 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
os.unlink(args.libreoffice_pid_file)

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

Expand Down

0 comments on commit 8d2cd5f

Please sign in to comment.