F4: verify task recovery and document Prompt background jobs
This commit is contained in:
@@ -18,6 +18,26 @@ class Passthrough(FrameProcessor):
|
||||
|
||||
|
||||
class NativeJobTest(unittest.IsolatedAsyncioTestCase):
|
||||
async def test_native_timeout_calls_remote_cleanup(self):
|
||||
cancelled = asyncio.Event()
|
||||
|
||||
async def execute(message, worker):
|
||||
await asyncio.Event().wait()
|
||||
|
||||
async def cleanup(message):
|
||||
cancelled.set()
|
||||
|
||||
async def ignore(message):
|
||||
pass
|
||||
|
||||
runtime = NativeTaskRuntime(execute, cleanup, ignore, ignore)
|
||||
await runtime.start()
|
||||
try:
|
||||
await runtime.submit("timeout-test", 0.05)
|
||||
await asyncio.wait_for(cancelled.wait(), 2)
|
||||
finally:
|
||||
await runtime.close()
|
||||
|
||||
async def test_progress_completion_and_media_disconnect(self):
|
||||
progress, finished, release = asyncio.Event(), asyncio.Event(), asyncio.Event()
|
||||
results = []
|
||||
|
||||
Reference in New Issue
Block a user