Skip to content

test: Remove logspam when running test suite - #10392

Open
gonfunko wants to merge 1 commit into
mainfrom
test-logspam
Open

test: Remove logspam when running test suite#10392
gonfunko wants to merge 1 commit into
mainfrom
test-logspam

Conversation

@gonfunko

@gonfunko gonfunko commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

The basics

The details

Proposed Changes

This PR avoids several thousand lines of errors and warnings in the devtools console when running the Mocha test suite. There are now less than a dozen warnings from when tests actually try to do naughty things.

These changes fall into several buckets:

  • Only register the p5 blocks once
  • Make the test workspace scrollable to avoid lots of whining from the bumpIntoBounds handler about events not having groups during teardown
  • Check if unregistering is actually needed during test teardown
  • Move up the shared event listener teardown to before workspace teardown

There are also a few core changes. While these mostly show up in a test context, they all could happen during actual use, so I think the changes are justified:

  • The block paster focuses the pasted block after a delay, and now checks to make sure that it hasn't been disposed of in between pasting and that callback firing
  • FieldInput.resizeEditor_ is more defensive instead of force unwrapping the WidgetDiv
  • The WorkspaceAudio manager is more defensive and only attempts to play audio when not suspended by the browser

Reason for Changes

Less logspam makes debugging new tests easier and increases the likelihood that important log messages from the test suite are noticed and acted upon.

@gonfunko
gonfunko requested a review from a team as a code owner August 31, 2026 22:05
@gonfunko
gonfunko requested a review from maribethb August 31, 2026 22:05
});
Blockly.common.defineBlocks(p5blocks);
if (!('p5_setup' in Blockly.Blocks)) {
Blockly.common.defineBlocks(p5blocks);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think ideally these tests that register blocks should unregister them at the end of their tests

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.

2 participants