On Thu, Feb 24, 2022 at 5:22 PM Ian Haywood <ian@haywood.id.au> wrote:

On 24/02/2022 7:18 pm, Chris Withers wrote:
>
> On 23/02/2022 22:04, Jean-Paul Calderone wrote:
>> Apart from that, a couple other trial issues that bothered me
>> recently are:
>>
>>   * https://twistedmatrix.com/trac/ticket/10311
>>     <https://twistedmatrix.com/trac/ticket/10311>
>>   * https://twistedmatrix.com/trac/ticket/10312
>>     <https://twistedmatrix.com/trac/ticket/10312>
>
> If these bother you, I feel like I must be missing something obvious:
> What's the correct way to end a trial -u run such that you don't get
> an ugly traceback and a non-zero return code when it's been running
> for a while and no tests have failed?

I have to to confess I've never used -u and I would assume it's for
catching some subtle nondeterministic bugs (hardware, threads or other
strangeness)

if it has a more general use, i'd be keen to know

Anyway, the problem is it's behaviour changes with -jN

Internally -jN causes a separate test runner to be used, see
https://github.com/twisted/twisted/blob/trunk/src/twisted/trial/_dist/disttrial.py

this is where the difference in behaviour lies. The fix seems
straightforward enough (I think the two tickets can be fixed in one PR)

Not sure how to write a test case though

From just a quick skim of the part of the implementation dealing with `--until-failure` behavior, I guess that I would try to refactor so that `trial -u -jN` and `trial -u` share their implementation of this functionality instead of each implementing it separately.  If `trial -u` already has tests and you can get rid of the dedicated `trial -u -jN` code that's a big step towards the testing goal - and always better to delete unnecessary code than to keep it, fix it, and have to write and maintain tests for it.

However, like I said, I only gave the code a brief skim.  For all I know, there is some major hurdle in the way of such a refactoring.

Jean-Paul
 

Ian

>
> cheers,
>
> Chris
> _______________________________________________
> Twisted mailing list -- twisted@python.org
> To unsubscribe send an email to twisted-leave@python.org
> https://mail.python.org/mailman3/lists/twisted.python.org/
> Message archived at
> https://mail.python.org/archives/list/twisted@python.org/message/IK6NBM3LV2TE7RSKVS6RQHG7MBEBZKZB/
> Code of Conduct: https://twisted.org/conduct
_______________________________________________
Twisted mailing list -- twisted@python.org
To unsubscribe send an email to twisted-leave@python.org
https://mail.python.org/mailman3/lists/twisted.python.org/
Message archived at https://mail.python.org/archives/list/twisted@python.org/message/TUQ25WTXTEMHMX3KV4F3GTVGEW7XTRFE/
Code of Conduct: https://twisted.org/conduct