Closed john-woolley closed 7 months ago
Attention: 11 lines
in your changes are missing coverage. Please review.
Comparison is base (
acb29c9
) 88.039% compared to head (0f22249
) 87.892%.:exclamation: Current head 0f22249 differs from pull request most recent head 062adaa. Consider uploading reports for the commit 062adaa to get more accurate results
Files | Patch % | Lines |
---|---|---|
sanic/worker/manager.py | 31.250% | 8 Missing and 3 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
________________________ test_terminate_durable_worker _________________________
manager = <sanic.worker.manager.WorkerManager object at 0x7f4f58e75190>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f4f58f30910>
def test_terminate_durable_worker(manager: WorkerManager, caplog):
worker = manager.manage("TEST", fake_serve, kwargs={})
assert "Sanic-TEST-0" in worker.worker_state
assert len(manager.transient) == 1
assert len(manager.durable) == 1
manager.terminate_durable_worker("WRONG")
message = "Durable worker termination failed because WRONG not found."
assert "Sanic-TEST-0" in worker.worker_state
assert len(manager.transient) == 1
assert len(manager.durable) == 1
> assert ("sanic.error", 40, message) in caplog.record_tuples
E AssertionError: assert ('sanic.error', 40, 'Durable worker termination failed because WRONG not found.') in [('sanic.error', 40, 'Durable worker termination failed (None not found).')]
E + where [('sanic.error', 40, 'Durable worker termination failed (None not found).')] = <_pytest.logging.LogCaptureFixture object at 0x7f4f58f30910>.record_tuples
/home/runner/work/sanic/sanic/tests/worker/test_manager.py:433: AssertionError```
Closing this for now until I figure this out.
I had a usecase for this in a project I'm working on and I thought it might be useful. Happy to make any changes to be more in-line with the existing codebase or planned trajectory.