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

E2E Tests: Intermittent failure in "Allowed Blocks Setting on InnerBlocks" #21052

Closed
aduth opened this issue Mar 20, 2020 · 2 comments · Fixed by #21175
Closed

E2E Tests: Intermittent failure in "Allowed Blocks Setting on InnerBlocks" #21052

aduth opened this issue Mar 20, 2020 · 2 comments · Fixed by #21175
Assignees
Labels
[Package] E2E Tests /packages/e2e-tests [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@aduth
Copy link
Member

aduth commented Mar 20, 2020

Example:

FAIL packages/e2e-tests/specs/editor/plugins/inner-blocks-allowed-blocks.test.js (12.448s)
  Allowed Blocks Setting on InnerBlocks 
    ✓ allows all blocks if the allowed blocks setting was not set (4146ms)
    ✓ allows the blocks if the allowed blocks setting was set (3206ms)
    ✕ correctly applies dynamic allowed blocks restrictions (3588ms)
  ● Allowed Blocks Setting on InnerBlocks  › correctly applies dynamic allowed blocks restrictions
    expect(received).toEqual(expected) // deep equality
    - Expected
    + Received
      Array [
    -   "Gallery",
    -   "Video",
    +   "Image",
    +   "List",
      ]
      76 | 		await page.click( appenderSelector );
      77 | 		await openAllBlockInserterCategories();
    > 78 | 		expect( await getAllBlockInserterItemTitles() ).toEqual( [
         | 		                                                ^
      79 | 			'Gallery',
      80 | 			'Video',
      81 | 		] );
      at Object.toEqual (specs/editor/plugins/inner-blocks-allowed-blocks.test.js:78:51)
          at runMicrotasks (<anonymous>)
@aduth aduth added [Type] Bug An existing feature does not function as intended [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Package] E2E Tests /packages/e2e-tests labels Mar 20, 2020
@aduth
Copy link
Member Author

aduth commented Mar 26, 2020

The test attempts to verify that after a block is inserted in a parent block, the parent updates the settings of its InnerBlocks to restrain the allowed blocks.

There's a couple known async behaviors in here which could be causing race conditions:

  1. Async rendering of the block list may only rerender parent or appender after scheduled delay.
    • That said, I seem recall there being some logic explicitly handling synchronous rendering of a block's own parent.
  2. Settings are only updated after the next render of InnerBlocks, during componentDidUpdate (source)

@aduth
Copy link
Member Author

aduth commented Mar 26, 2020

Async rendering of the block list may only rerender parent or appender after scheduled delay.

  • That said, I seem recall there being some logic explicitly handling synchronous rendering of a block's own parent.

This synchronous rendering of parents was removed as of #19343, so it's quite likely this is related (if not the direct cause).

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Mar 26, 2020
@aduth aduth removed the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Tests /packages/e2e-tests [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant