Skip to content

Commit

Permalink
Ensure comms are cleaned up during tests
Browse files Browse the repository at this point in the history
Disable lldb & gdb gha steps
  • Loading branch information
langmm committed Aug 31, 2023
1 parent 23288e7 commit 90f3455
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ jobs:
# Test Python
###################################
- name: Test Python Interfaces (CONDA)
# if: matrix.python-install == 'conda' && matrix.with-asan == false && matrix.with-elf == false && matrix.with-valgrind == false
if: matrix.python-install == 'conda' && matrix.with-elf == false && matrix.with-valgrind == false
shell: bash -l {0}
run: |
Expand All @@ -354,16 +353,15 @@ jobs:
# ${PYTHON_EXEC} -c 'import site; print(site.getsitepackages())'
# ls $(${PYTHON_EXEC} -c 'import site; print(site.getsitepackages()[0])')
# ls $(${PYTHON_EXEC} -c 'import os; import site; print(os.path.join(site.getsitepackages()[0], "pyYggdrasil"))')
- name: Test Python Interfaces w/ LLDB (PIP)
if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false && matrix.os == 'macos-latest'
run: |
lldb -o 'run' -o 'quit' -- $(which python) -m pytest -svx python/test
- name: Test Python Interfaces w/ GDB (PIP)
if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false && matrix.os == 'ubuntu-latest'
run: |
gdb --batch -x gdb_commands.txt --args $(which python) -m pytest -svx python/test
# - name: Test Python Interfaces w/ LLDB (PIP)
# if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false && matrix.os == 'macos-latest'
# run: |
# lldb -o 'run' -o 'quit' -- $(which python) -m pytest -svx python/test
# - name: Test Python Interfaces w/ GDB (PIP)
# if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false && matrix.os == 'ubuntu-latest'
# run: |
# gdb --batch -x gdb_commands.txt --args $(which python) -m pytest -svx python/test
- name: Test Python Interfaces (PIP)
# if: matrix.python-install == 'pip' && matrix.with-asan == false && matrix.with-elf == false && matrix.with-valgrind == false
if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false
run: |
pytest -sv python/test
Expand Down
8 changes: 7 additions & 1 deletion python/test/test_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ class TestRPC:

@pytest.fixture
def server(self):
return pyYggdrasil.CommBase(
out = pyYggdrasil.CommBase(
"test_server", commtype=pyYggdrasil.COMM_TYPE.SERVER_COMM)
yield out
out.close()

@pytest.fixture
def create_comm_partner(self):
Expand All @@ -238,6 +240,7 @@ def do_call_wrapped(server, msg, result_call_thread, **kwargs):
client = create_comm_partner(server, **kwargs)
client.timeout_recv = 1000000
result_call_thread[0] = client.call(msg)
client.close()

return do_call_wrapped

Expand Down Expand Up @@ -298,6 +301,8 @@ def test_send_recv_async(self):
assert server.recv() == (True, req)
assert server.send(res)
assert client.recv() == (True, res)
client.close()
server.close()

def test_call_async(self, do_rpc):
server = pyYggdrasil.CommBase(
Expand All @@ -306,3 +311,4 @@ def test_call_async(self, do_rpc):
flags=pyYggdrasil.COMM_FLAGS.COMM_FLAG_ASYNC)
do_rpc(server, "REQUEST", "RESPONSE",
flags=pyYggdrasil.COMM_FLAGS.COMM_FLAG_ASYNC)
server.close()

0 comments on commit 90f3455

Please sign in to comment.