Hi Martin, Here is the relevant issue for the last change in that method: https://pharo.fogbugz.com/f/cases/14989/Improve-and-simplify-BlockClosure-be... IIRC the timing change was done in Squeak too, not the BenchmarkResult object. Maybe the old code is more reliable, thing is, the CI machines being VM's sometimes act very weird with respect to timing and clocks. Sven
On 12 Nov 2015, at 02:45, Martin Dias <tinchodias@gmail.com> wrote:
I also tried with a modified #benchFor: that doesn't use a forked block, and that fixed the issue.
benchFor: duration "Run me for duration and return a BenchmarkResult"
"[ 100 factorial ] benchFor: 2 seconds"
| count started endTime | count := 0. started := Time millisecondClockValue. endTime := started + duration asMilliSeconds. [ Time millisecondClockValue > endTime ] whileTrue: [ self value. count := count + 1 ]. ^ BenchmarkResult new iterations: count; elapsedTime: (Time millisecondsSince: started) milliSeconds; yourself
Do you think comparing each time, instead of using #fork is a bad idea? That's how it was working #bench in Pharo 3.
Martin
On Thu, Nov 12, 2015 at 2:42 AM, Martin Dias <tinchodias@gmail.com> wrote: Hello,
I'm trying to understand why this method hangs in certain conditions*. What happens is that the #whileTrue: in the following method is never cut.
benchFor: duration "Run me for duration and return a BenchmarkResult"
"[ 100 factorial ] benchFor: 2 seconds"
| count run started | count := 0. run := true. [ duration wait. run := false ] forkAt: Processor timingPriority - 1. started := Time millisecondClockValue. [ run ] whileTrue: [ self value. count := count + 1 ]. ^ BenchmarkResult new iterations: count; elapsedTime: (Time millisecondsSince: started) milliSeconds; yourself
Strangely, I verified with several #logCr that the forked block starts, but the #wait never ends. ---> Maybe you see something I don't in the code. Any clue?
I will continue trying to isolate the problem, but maybe you have some idea.
* the conditions to reproduce are: 1) curl get.pharo.org/50+vm | bash 2) ./pharo Pharo.image get Epicea 6.5 3) ./pharo Pharo.image test '^(?!Metacello)[A-L].*'
Notes: - It doesn't hang when running from UI - it doesn't hang when running less tests, like: pharo Pharo.image test '^(?!Metacello)[E-L].*' - it *does* hang even when removing all Epicea tests - Epicea doesn't extend or override "kernel" behavior...
Regards, Martin