mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-01 21:45:10 +00:00
fix(remote): end a remote session from before its create to after its DELETE
This commit is contained in:
@@ -44,6 +44,7 @@ from unshackle.core.utilities import close_debug_logger, init_debug_logger
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
KEY = "loopback-key"
|
||||
OTHER_KEY = "other-key"
|
||||
CODE = "1234"
|
||||
|
||||
|
||||
@@ -157,7 +158,7 @@ def server(request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch, tmp_
|
||||
stub_service_build(monkeypatch, lambda: StubService(beats))
|
||||
|
||||
app = web.Application(middlewares=[record, cors_middleware, no_5xx_middleware, api_key_authentication])
|
||||
app["config"] = {"users": [KEY]}
|
||||
app["config"] = {"users": [KEY, OTHER_KEY]}
|
||||
setup_routes(app, remote_only=True)
|
||||
loop = asyncio.new_event_loop()
|
||||
runner = web.AppRunner(app)
|
||||
@@ -501,7 +502,7 @@ def test_an_open_channel_keeps_the_session_alive(server: SimpleNamespace, monkey
|
||||
assert count(server, "GET", SESSION_ROUTE, session_id) == 0
|
||||
assert count(server, "GET", LOGS_ROUTE) == count(server, "GET", PROMPT_ROUTE) == 0
|
||||
|
||||
service.close_channel()
|
||||
service.lifetime.close_channel()
|
||||
assert wait_until(lambda: not entry.channel.attached, 5)
|
||||
assert wait_until(lambda: idle_seconds(entry) > 2 * ttl, 10)
|
||||
assert on_loop(server, store.cleanup_expired()) == 1
|
||||
|
||||
Reference in New Issue
Block a user