goodboy / tractor

A distributed, structured concurrent runtime for Python (and friends)
GNU Affero General Public License v3.0
258 stars 12 forks source link

Harden cluster tests #344

Closed goodboy closed 1 year ago

goodboy commented 1 year ago

In response to a weird issue discovered by @guilledk where if you pass in a mngrs=(<generator comprehension>), you end up with an empty sequence in the loop inside trionics.gather_contexts() and then a hang due to waiting on the all_entered: trio.Event just after the loop.

This solves the issue by greedly converting the mngrs sequence to a list and ensuring its size and otherwise raising a ValueError.


Further TODO for this to land:


Other additions part of this patch:

goodboy commented 1 year ago

interesting i think 38326e8 makes the debugger tests pass that were failing on last run. I did a little local manual testing and it seems there can be transient failures on teardown..

I'm not sure if we should write an independent test to catch this since it's more of an auxillary teardown error that shouldn't (often) be a direct issue?