The implementation kills a currently executed greenlet (<Test instance>.current_test_greenlet) in the case of fail of a non-default instance. A greenlet that is stored in the <Test instance>.current_test_greenlet field may be killed at any point by the kill_current_test() method.
So we can assume some predicates after <greenlet>.join() as true, however it may be not so. And the greenlet will not perform any shutdown actions: they should be done outside, somewhere after <greenlet>.join() / <greenlet>.get(). That's all make the code less obvious.
We already store all servers that are related to a particular test in the TestState object. So, maybe, we can reverse the dependency and periodically check whether a failure of any other server occurs from a code that executes a test.
The implementation kills a currently executed greenlet (
<Test instance>.current_test_greenlet) in the case of fail of a non-default instance. A greenlet that is stored in the<Test instance>.current_test_greenletfield may be killed at any point by thekill_current_test()method.So we can assume some predicates after
<greenlet>.join()as true, however it may be not so. And the greenlet will not perform any shutdown actions: they should be done outside, somewhere after<greenlet>.join()/<greenlet>.get(). That's all make the code less obvious.We already store all servers that are related to a particular test in the TestState object. So, maybe, we can reverse the dependency and periodically check whether a failure of any other server occurs from a code that executes a test.