Skip to content

Commit

Permalink
DEBUG/DROPME: Mac, what doing?
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink committed Nov 25, 2024
1 parent 3ce7030 commit ac1ee32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ipv8/taskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,22 @@ async def after_cancel() -> None:
await cast(Awaitable, fut)

done_future.after_cancel_task = after_cancel() # type: ignore[attr-defined]
self.register_anonymous_task(f"[Catch shutdown] {basename}", catch_shutdown)
self.register_anonymous_task(f"[Run shutdown] {basename}",
shield(done_future.after_cancel_task)) # type: ignore[attr-defined]
t1 = self.register_anonymous_task(f"[Catch shutdown] {basename}", catch_shutdown)
t2 = self.register_anonymous_task(f"[Run shutdown] {basename}",
shield(done_future.after_cancel_task)) # type: ignore[attr-defined]

print()
print(t1)
print(t2)
print(done_future)

await sleep(0) # Enter both infinite loops

print(t1)
print(t2)
print(done_future)


return done_future

def cancel_pending_task(self, name: Hashable) -> Future:
Expand Down
2 changes: 2 additions & 0 deletions ipv8/test/test_taskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ async def test_register_shutdown_task(self) -> None:

await self.tm.shutdown_task_manager()

print(fut) # TODO: Mac, what are you doing!?

self.assertTrue(fut.done())
self.assertTrue(sub_fut.cancelled())

Expand Down

0 comments on commit ac1ee32

Please sign in to comment.