Image unresponsive when debugging a test with error in Test Runner
Steps:
- Get P8.0
curl https://get.pharo.org/64/80+vm | bash - Evaluate:
Metacello new
baseline: 'NewBloc';
repository: 'github://pharo-graphics/Bloc/src';
load
- Open Test Runner, filter test packages with "Bloc", then select all test suites.
- Run tests to obtain the list of results (as in the screen capture below)
- Click on
BlElementTest>>#testDefaultand the image gets unresponsive (andcmd+.doesn't help). Terminal shows a recurrent error like shown below).
Stack trace:
Instance of BlUniverse did not understand #uiProcessDo:
BlUniverse(Object)>>doesNotUnderstand: #uiProcessDo:
[ :eachUniverse |
| isUIProcess |
isUIProcess := false.
eachUniverse hostClass
uiProcessDo: [ :eachUIProcess | isUIProcess := eachUIProcess == activeProcess ].
isUIProcess ] in MorphicUIManager>>spawnNewProcess in Block: [ :eachUniverse | ...
[ :each |
(aBlock value: each)
ifTrue: [ ^ foundBlock cull: each ] ] in Array(Collection)>>detect:ifFound:ifNone: in Block: [ :each | ...
Array(SequenceableCollection)>>do:
Array(Collection)>>detect:ifFound:ifNone:
MorphicUIManager>>spawnNewProcess
[ self spawnNewProcess ] in MorphicUIManager>>debugProcess:context:label:fullView:notification: in Block: [ self spawnNewProcess ]
CurrentExecutionEnvironment class>>activate:for:
DefaultExecutionEnvironment(ExecutionEnvironment)>>beActiveDuring:
DefaultExecutionEnvironment class>>beActiveDuring:
MorphicUIManager>>debugProcess:context:label:fullView:notification:
MorphicUIManager(UIManager)>>debugProcess:context:label:fullView:
Process>>debug:title:full:
Process>>debug:title:
MessageNotUnderstood>>debug
MorphicUIManager>>unhandledErrorDefaultAction:
UnhandledError>>defaultAction
UndefinedObject>>handleSignal:
UnhandledError(Exception)>>signal
UnhandledError class>>signalForException:
MessageNotUnderstood(Error)>>defaultAction
MessageNotUnderstood>>defaultAction
UndefinedObject>>handleSignal:
MessageNotUnderstood(Exception)>>signal
BlUniverse(Object)>>doesNotUnderstand: #uiProcessDo:
[ :eachUniverse |
| isUIProcess |
isUIProcess := false.
eachUniverse hostClass
uiProcessDo: [ :eachUIProcess | isUIProcess := eachUIProcess == activeProcess ].
isUIProcess ] in MorphicUIManager>>spawnNewProcess in Block: [ :eachUniverse | ...
[ :each |
(aBlock value: each)
ifTrue: [ ^ foundBlock cull: each ] ] in Array(Collection)>>detect:ifFound:ifNone: in Block: [ :each | ...
Array(SequenceableCollection)>>do:
Array(Collection)>>detect:ifFound:ifNone:
MorphicUIManager>>spawnNewProcess
I explored a bit more on the stack trace and noticed that the infinite loop is triggered by MorphicUIManager>>#spawnNewProcess which is overriden by an extension method from the original:
spawnNewProcess
UIProcess := [
[WorldMorph doOneCycle. Processor yield. false] whileFalse: [].
] newProcess priority: Processor userSchedulingPriority.
UIProcess name: 'Morphic UI Process'.
UIProcess resume
to
spawnNewProcess
| activeProcess |
"In case the current process is attached to a Bloc universe, stop pulsation to allow the new UI process to step.
This assumes that the current process is the UI process and will be interrupted. "
activeProcess := Processor activeProcess.
BlParallelUniverse all
detect: [ :eachUniverse |
| isUIProcess |
isUIProcess := false.
eachUniverse hostClass
uiProcessDo: [ :eachUIProcess | isUIProcess := eachUIProcess == activeProcess ].
isUIProcess ]
ifFound: [ :aUniverse |
aUniverse requestStopPulsation ]
ifNone: [ ].
UIProcess := [
[WorldMorph doOneCycle. Processor yield. false] whileFalse: [].
] newProcess priority: Processor userSchedulingPriority.
UIProcess name: 'Morphic UI Process'.
UIProcess resume
So a test may be adding a BlParallelUniverse whose hostClass doesn't respond to uiProcessDo:. May be an outdated test.
Removing this test this issue doesn't reproduce:
BlDeferredActionTest>>
testDeferredAction
| runFlag processflag |
processflag := runFlag := false.
BlUniverse reset.
BlUniverse default
start;
defer: [ runFlag := true.
processflag := BlUniverse default isUIProcess ].
(Delay forSeconds: 1) wait.
BlUniverse reset.
self assert: runFlag description:'the deferred action should be run'.
self assert: processflag description:'the deferred action should be run within the UI Process'.
In my image, the implementors of #uiProcessDo: that can fit there as receives are BlHeadlessHost and BlMorphicSteppingHost (subclasses of BlHost).
In a GT image, I opened a Calypso on BlDeferredActionTest class and the test was red. I didn't debug it but looks like broken.
Closed via commit c8ab99c