Fix cluster suite, chng to new `gather_contexts()`
Namely `test_empty_mngrs_input_raises()` was failing due to lazy-iterator use as input to `mngrs` which i guess i added support for a while back (by it doing a `list(mngrs)` internally)? So just change it to `gather_contexts(mngrs=())` and also tweak the `trio.fail_after(3)` since it appears that the prior 1sec was causing too-fast-of-a-cancellation (before the cluster fully spawned) and thus the expected `ValueError` never to show.. Also, mask the `tractor.trionics.collapse_eg()` usage (again?) in `open_actor_cluster()` since it seems unnecessary.
							parent
							
								
									72e86b0555
								
							
						
					
					
						commit
						f727669d77
					
				| 
						 | 
				
			
			@ -13,27 +13,22 @@ MESSAGE = 'tractoring at full speed'
 | 
			
		|||
def test_empty_mngrs_input_raises() -> None:
 | 
			
		||||
 | 
			
		||||
    async def main():
 | 
			
		||||
        with trio.fail_after(1):
 | 
			
		||||
        with trio.fail_after(3):
 | 
			
		||||
            async with (
 | 
			
		||||
                open_actor_cluster(
 | 
			
		||||
                    modules=[__name__],
 | 
			
		||||
 | 
			
		||||
                    # NOTE: ensure we can passthrough runtime opts
 | 
			
		||||
                    loglevel='info',
 | 
			
		||||
                    # debug_mode=True,
 | 
			
		||||
                    loglevel='cancel',
 | 
			
		||||
                    debug_mode=False,
 | 
			
		||||
 | 
			
		||||
                ) as portals,
 | 
			
		||||
 | 
			
		||||
                gather_contexts(
 | 
			
		||||
                    mngrs=(
 | 
			
		||||
                        p.open_context(worker) for p in portals.values()
 | 
			
		||||
                    ),
 | 
			
		||||
                  # ^^NOTE XXX ^^^
 | 
			
		||||
                    # it's the use of inline-generator syntax here
 | 
			
		||||
                    # that causes the "empty input" -> ValueError,
 | 
			
		||||
                    # see `._clustering` impl.
 | 
			
		||||
                ),
 | 
			
		||||
                gather_contexts(mngrs=()),
 | 
			
		||||
            ):
 | 
			
		||||
                # should fail before this?
 | 
			
		||||
                assert portals
 | 
			
		||||
 | 
			
		||||
                # test should fail if we mk it here!
 | 
			
		||||
                assert 0, 'Should have raised val-err !?'
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,7 +62,7 @@ async def open_actor_cluster(
 | 
			
		|||
        ) as an
 | 
			
		||||
    ):
 | 
			
		||||
        async with (
 | 
			
		||||
            tractor.trionics.collapse_eg(),
 | 
			
		||||
            # tractor.trionics.collapse_eg(),
 | 
			
		||||
            trio.open_nursery() as tn,
 | 
			
		||||
            tractor.trionics.maybe_raise_from_masking_exc()
 | 
			
		||||
        ):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue