pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Prevent BlockClosure>>benchFor: to loop infinitely

Open privat opened this issue 3 years ago • 2 comments

[ 100 factorial ] benchFor: 5 hangs since 5 wait silently fails (5 is not a duration) thus run never became false.

The PR adds the catch of exceptions, ensure run is set to false, and reraises the exception on the main thread (so the user can see and debug it).

Questions for reviewers: It is OK to just exeption signal to reraise the exception in the correct thread?

privat avatar Sep 19 '22 16:09 privat

Often a pattern used is to force conversion of the parameter

benchFor: aParam
    param := aParam asSeconds

But here it is not that nice since we can pass seconds and millisecond even if benching using milliseconds does not make that much sense.

S

Ducasse avatar Sep 19 '22 18:09 Ducasse

Failing tests not related:

  • [CI] Failing test: ProperMethodCategorizationTest>>testNoUncategorizedMethods #11669
  • [CI] Mac executor down due to network issues #11697

MarcusDenker avatar Sep 20 '22 08:09 MarcusDenker