hard to debug multi-threaded tests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

hard to debug multi-threaded tests

Ben Coman
In Pharo 5, it was possible to do...

TestCase subclass: #Example
....etc

Example >> test1
[ Transcript
crShow: Processor activeProcess priority printString;
tab;
show: Processor activeProcess name.
self halt.
Transcript
crShow: Processor activeProcess effectiveProcess priority printString;
tab;
show: Processor activeProcess effectiveProcess name 
] forkAt: 39 named: 'TEST'.

...and when this was run, a debugger would show for the forked code 
and stepping through it would produce the following output...
39 TEST
39 TEST


In Pharo 71047, no debugger shows up, 
and you only get one...
39 TEST


I guess this because more cleanup of tests is being done,
but it makes it harder to debug multi-threaded tests when 
debugger can't replicate the way the code normally runs.

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: hard to debug multi-threaded tests

Ben Coman


On 13 June 2018 at 20:29, Ben Coman <[hidden email]> wrote:
In Pharo 5, it was possible to do...

TestCase subclass: #Example
....etc

Example >> test1
[ Transcript
crShow: Processor activeProcess priority printString;
tab;
show: Processor activeProcess name.
self halt.
Transcript
crShow: Processor activeProcess effectiveProcess priority printString;
tab;
show: Processor activeProcess effectiveProcess name 
] forkAt: 39 named: 'TEST'.

...and when this was run, a debugger would show for the forked code 
and stepping through it would produce the following output...
39 TEST
39 TEST


In Pharo 71047, no debugger shows up, 
and you only get one...
39 TEST


I guess this because more cleanup of tests is being done,
but it makes it harder to debug multi-threaded tests when 
debugger can't replicate the way the code normally runs.

Ahhh, but it works to add a halt at the end of the test....

Example >> test1
[ Transcript
crShow: Processor activeProcess priority printString;
tab;
show: Processor activeProcess name.
self halt.
Transcript
crShow: Processor activeProcess effectiveProcess priority printString;
tab;
show: Processor activeProcess effectiveProcess name 
] forkAt: 39 named: 'TEST'.
        self halt.

Sorry for the noise.

cheers -ben