Skip to content

Commit

Permalink
Data updater tests: Fix cleaning up undefined resource
Browse files Browse the repository at this point in the history
  • Loading branch information
roekatz committed Aug 28, 2024
1 parent b323d1e commit d119c1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/opal-client/opal_client/tests/data_updater_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ async def test_data_updater_with_report_callback(server):
res = await session.get(CHECK_DATA_UPDATE_CALLBACK_URL)
current_callback_count = await res.json()

proc2 = None
try:
proc = multiprocessing.Process(target=trigger_update, daemon=True)
proc.start()
Expand Down Expand Up @@ -283,7 +284,8 @@ async def test_data_updater_with_report_callback(server):
finally:
await updater.stop()
proc.terminate()
proc2.terminate()
if proc2:
proc2.terminate()


@pytest.mark.asyncio
Expand Down

0 comments on commit d119c1c

Please sign in to comment.