Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewFinderTests are breaking on the build #16041

Closed
Ducasse opened this issue Jan 27, 2024 · 4 comments
Closed

NewFinderTests are breaking on the build #16041

Ducasse opened this issue Jan 27, 2024 · 4 comments
Assignees
Labels

Comments

@Ducasse
Copy link
Member

Ducasse commented Jan 27, 2024

**BBeginning to run tests of NewTools-Finder-Tests with random seed 290922244
SubscriptOutOfBounds: 1 in an OrderedCollection()
[:err |
		"Handle a drawing error"
		| errCtx errMorph |
		errCtx := thisContext.
		[
			errCtx := errCtx sender.
			"Search the sender chain to find the morph causing the problem"
			[errCtx isNotNil and:[(errCtx receiver isMorph) not]]
				whileTrue:[errCtx := errCtx sender].
			"If we're at the root of the context chain then we have a fatal drawing problem"
			errCtx ifNil:[^self handleFatalDrawingError: err description].
			errMorph := errCtx receiver.
			"If the morph causing the problem has already the #drawError flag set,
			then search for the next morph above in the caller chain."
			errMorph hasProperty: #errorOnDraw
		] whileTrue.
		errMorph setProperty: #errorOnDraw toValue: true.
		"Install the old error handler, so we can re-raise the error"
		err signal.
	] in WorldState>>displayWorldSafely: in Block: [:err |...
FullBlockClosure(BlockClosure)>>cull:
[:ex | errorHandlerBlock cull: ex] in FullBlockClosure(BlockClosure)>>onErrorDo: in Block: [:ex | errorHandlerBlock cull: ex]
FullBlockClosure(BlockClosure)>>cull:
Context>>evaluateSignal:
Context>>handleSignal:
Context>>handleSignal:
SubscriptOutOfBounds(Exception)>>signal
SubscriptOutOfBounds class>>signalFor:lowerBound:upperBound:in:
SubscriptOutOfBounds class>>signalFor:lowerBound:upperBound:
SubscriptOutOfBounds class>>signalFor:
OrderedCollection(Object)>>errorSubscriptBounds:
OrderedCollection>>at:
RubParagraph>>characterBlockForIndex:
RubShoutStylerDecorator(RubParagraphDecorator)>>characterBlockForIndex:
RubPrimarySelectionMorph(RubTextSegmentMorph)>>characterBlockForIndex:
RubPrimarySelectionMorph(RubTextSegmentMorph)>>computeStraightVertices
RubPrimarySelectionMorph(RubTextSegmentMorph)>>computeVertices
RubPrimarySelectionMorph(RubTextSegmentMorph)>>whenExtentChanged:
MessageSend>>value:
MessageSend>>cull:
MessageSend>>cull:cull:
[ action cull: anAnnouncement cull: announcer ] in AnnouncementSubscription(AbstractAnnouncementSubscription)>>deliver: in Block: [ action cull: anAnnouncement cull: announcer ]
FullBlockClosure(BlockClosure)>>on:do:
FullBlockClosure(BlockClosure)>>on:fork:
AnnouncementSubscription(AbstractAnnouncementSubscription)>>deliver:
[ subscription deliver: anAnnouncement ] in SubscriptionRegistry>>deliver:to:startingAt: in Block: [ subscription deliver: anAnnouncement ]
FullBlockClosure(BlockClosure)>>ifCurtailed:
SubscriptionRegistry>>deliver:to:startingAt:
SubscriptionRegistry>>deliver:to:
ug description**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version information:**
 - OS: [e.g. iOS]
 - Version: [e.g. 1.6.1]
 - Pharo Version [e.g 9]

**Expected development cost**
As you know nothing happens magically, so do you have an idea of the development effort required? 
In addition, are you willing to help because after all Pharo is yours too?

**Additional context**
Add any other context about the problem here.

@Rinzwind
Copy link
Contributor

I guess the above is from the log of the build for pull request #16037?

The following Dockerfile can be used to reproduce the error with some additional logging:

FROM almalinux:9
# The following file is from: https://github.com/pharo-project/pharo-launcher/actions/runs/7669561590
COPY PharoLauncher-linux-37d81461-x64.zip .
RUN yum install -y unzip && yum clean all && rm -rf /var/cache/yum
RUN unzip -p PharoLauncher-linux-37d81461-x64.zip | tar -x
RUN mkdir /root/Pharo
RUN ./pharo-launcher/pharo-launcher image create fromBuild --newImageName test-image 1320
RUN /root/Pharo/vms/120-x64/pharo --headless /root/Pharo/images/test-image/test-image.image eval " \
	StFinderTest compile: 'performTest \
		Stdio stderr nextPutAll: (''Performing test (test: {1}, process: {2})'' format: { self asString. Processor activeProcess name }); lf. \
		^ super performTest'. \
	SubscriptOutOfBounds compile: 'signal \
		Stdio stderr nextPutAll: (''Signaling SubscriptOutOfBounds (process: {1})'' format: { Processor activeProcess name }); lf. \
		^ super signal'. \
	Smalltalk snapshot: true andQuit: true"
CMD /root/Pharo/vms/120-x64/pharo /root/Pharo/images/test-image/test-image.image test --junit-xml-output NewTools-Finder-Tests

Sample output with the error (after running it repeatedly as the error occurs ‘randomly’):

There was an error during copy, we should not throw an exception here:Error: Bad BitBlt arg (Fraction?); proceed to convert.
There was an error during copy, we should not throw an exception here:Error: Bad BitBlt arg (Fraction?); proceed to convert.
Running tests in 1 Packages
Performing test (test: StFinderClassTest>>#testSearchForExactCaseInsensitiveStringMissing, process: CommandLine handler process)
[…]
Performing test (test: StFinderExampleTest>>#testConcatenationSearch, process: CommandLine handler process)
Signaling SubscriptOutOfBounds (process: CommandLine handler process)
[…]
Performing test (test: StFinderSelectorTest>>#testSearchForExactCaseInsensitiveStringSucess, process: CommandLine handler process)
Signaling SubscriptOutOfBounds (process: Morphic UI Process)
Signaling SubscriptOutOfBounds (process: Morphic UI Process)
1 in an OrderedCollection()
[…]
OrderedCollection>>at:
RubParagraph>>characterBlockForIndex:
RubShoutStylerDecorator(RubParagraphDecorator)>>characterBlockForIndex:
RubPrimarySelectionMorph(RubTextSegmentMorph)>>characterBlockForIndex:
RubPrimarySelectionMorph(RubTextSegmentMorph)>>computeStraightVertices
RubPrimarySelectionMorph(RubTextSegmentMorph)>>computeVertices
RubPrimarySelectionMorph(RubTextSegmentMorph)>>whenExtentChanged:
[…]
SubscriptionRegistry>>deliver:to:startingAt:
Performing test (test: StFinderSelectorTest>>#testSearchForExactCaseSensitiveStringMissing, process: CommandLine handler process)
[…]
27 run, 27 passes, 0 failures, 0 errors.

As far as I understand, the error is due to concurrent accessing of morphs from within the command line handler and Morphic UI processes. I guess the tests should be changed so that either the window is not drawn, or the actions (#doSearch:, #setExactAndCaseInsensitive, …) are performed from within the Morphic UI process as well.

@Ducasse
Copy link
Member Author

Ducasse commented Jan 27, 2024

I think that your analysis is correct

@Rinzwind
Copy link
Contributor

The superclass of StFinderTest should probably be changed to SpBaseTest which ensures that the tests run within the Morphic UI process, see Spec pull request #1496 and issue #12502.

A somewhat related issue is issue #9638, which was fixed in pull request #14853 by similarly deferring to the Morphic UI process.

@hernanmd
Copy link
Member

Thanks for reporting. I couldn't reproduce it locally, but I've sent a PR pharo-spec/NewTools#669 with your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

3 participants