More aggressively shut down i2pd and other i2p-related processes.

This commit is contained in:
Itamar Turner-Trauring
2021-07-30 11:08:56 -04:00
parent 97522641d6
commit ce2363e3de

View File

@ -47,7 +47,7 @@ if sys.platform.startswith('win'):
pytest.skip('Skipping I2P tests on Windows', allow_module_level=True) pytest.skip('Skipping I2P tests on Windows', allow_module_level=True)
@pytest.fixture(scope="session") @pytest.fixture
def i2p_network(reactor, temp_dir, request): def i2p_network(reactor, temp_dir, request):
"""Fixture to start up local i2pd.""" """Fixture to start up local i2pd."""
proto = util._MagicTextProtocol("ephemeral keys") proto = util._MagicTextProtocol("ephemeral keys")
@ -63,7 +63,7 @@ def i2p_network(reactor, temp_dir, request):
def cleanup(): def cleanup():
try: try:
proto.transport.signalProcess("INT") proto.transport.signalProcess("KILL")
util.block_with_timeout(proto.exited, reactor) util.block_with_timeout(proto.exited, reactor)
except ProcessExitedAlready: except ProcessExitedAlready:
pass pass
@ -72,7 +72,7 @@ def i2p_network(reactor, temp_dir, request):
util.block_with_timeout(proto.magic_seen, reactor, timeout=30) util.block_with_timeout(proto.magic_seen, reactor, timeout=30)
@pytest.fixture(scope='session') @pytest.fixture
@log_call( @log_call(
action_type=u"integration:i2p:introducer", action_type=u"integration:i2p:introducer",
include_args=["temp_dir", "flog_gatherer"], include_args=["temp_dir", "flog_gatherer"],
@ -133,7 +133,7 @@ log_gatherer.furl = {log_furl}
return transport return transport
@pytest.fixture(scope='session') @pytest.fixture
def i2p_introducer_furl(i2p_introducer, temp_dir): def i2p_introducer_furl(i2p_introducer, temp_dir):
furl_fname = join(temp_dir, 'introducer_i2p', 'private', 'introducer.furl') furl_fname = join(temp_dir, 'introducer_i2p', 'private', 'introducer.furl')
while not exists(furl_fname): while not exists(furl_fname):