Skip to content

Conversation

@maribethb
Copy link
Collaborator

@maribethb maribethb commented Sep 5, 2025

Fixes #719 hopefully?

There was a bug in this test, it both opened the context menu and pressed 'm' to start move mode. But that wasn't enough to fix the flaky test.

I changed some of the assertions to be more specific. using chai.assert.isNull gives a better error message than chai.assert as chai knows more about what you're intending to check. the old error didn't tell you what the value was, which could help with debugging. the new message will say something like "expected null, got 123". That did give better error messages but still didn't fix anything (it wasn't supposed to)

Next I tried adding an assertion to make sure the problem wasn't with the context menu showing up. I added a check to make sure that the "Move" option was found, and that assertion never failed. Yet, the test flaked on.

I tried adding some pause time and still flaky, so removed it again.

I tried triggering the move with the 'm' key instead of the context menu and it was still flaky, so I reverted those commits.

Finally I added a "wait for exist" on the move icon, so that the test doesn't continue until move mode is actually activated. This required adding a class to the actual source code. All other changes are to the test code only.

At this point I don't know if it will solve the flaky test but even if it doesn't I think it's worth merging at this point as it does improve the tests.

@maribethb maribethb requested a review from a team as a code owner September 5, 2025 23:09
@maribethb maribethb requested review from BenHenning and removed request for a team September 5, 2025 23:09
@maribethb maribethb marked this pull request as draft September 8, 2025 16:06
@maribethb maribethb marked this pull request as ready for review September 8, 2025 16:56
@maribethb
Copy link
Collaborator Author

FWIW I've been rerunning the tests and the latest failure was a different flaky test, not this one :)

Copy link
Collaborator

@cpcallen cpcallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the unwanted m—and thanks for educating me about the existence of these various fancy assertions. This is definitely an improvement.

Comment on lines 141 to 142
const bubble = this.browser.$('.blocklyMoveIndicatorBubble');
await bubble.waitForExist();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If bubble isn't used again then why save it? (Unless line length?)

Suggested change
const bubble = this.browser.$('.blocklyMoveIndicatorBubble');
await bubble.waitForExist();
this.browser.$('.blocklyMoveIndicatorBubble').waitForExist();

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I had remembered running into issues with doing this previously but it was when I needed to assert something about bubble which I'm not doing in this case. Fixed (had to add await so didn't commit your suggestion but fixed it locally and pushed)

@maribethb maribethb merged commit b38e758 into RaspberryPiFoundation:main Sep 9, 2025
8 checks passed
@BenHenning
Copy link
Collaborator

Apologies for the delay--thanks for reviewing this @cpcallen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky test: move start test on ubuntu

3 participants