Skip to content

Commit

Permalink
Try manually killing the process associated with port 10000.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jun 3, 2024
1 parent f96a450 commit d2f79a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- eigen
- loguru
- pip
- psutil
- pybind11
- pytorch
- python < 3.11
Expand Down
1 change: 1 addition & 0 deletions environment_sire.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- loguru
- openmm >= 8.1
- pip
- psutil
- pybind11
- pytorch
- python < 3.11
Expand Down
16 changes: 10 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import pytest
import psutil
import shlex
import subprocess

Expand All @@ -12,9 +13,12 @@ def wrapper():

yield

# Stop the EMLE server.
process = subprocess.run(
shlex.split("emle-stop"),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
# Kill the EMLE server. We do this manually rather than using emle-stop
# because there is sometimes a delay in the termination of the server,
# which causes the next test # to fail. This only seems to happen when
# testing during CI.
for conn in psutil.net_connections(kind="inet"):
if conn.laddr.port == 10000:
process = psutil.Process(conn.pid)
process.terminate()
break

0 comments on commit d2f79a4

Please sign in to comment.