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

Flaky 'useMultiRootEditor' slow editor test #542

Open
f1ames opened this issue Oct 2, 2024 · 1 comment · May be fixed by #543
Open

Flaky 'useMultiRootEditor' slow editor test #542

f1ames opened this issue Oct 2, 2024 · 1 comment · May be fixed by #543
Assignees
Labels
squad:collaboration Issue to be handled by the Collaboration team. type:bug

Comments

@f1ames
Copy link
Contributor

f1ames commented Oct 2, 2024

The should assign properly data property to editor even if it is still mounting (see here) test fails randomly with:

- Expected
+ Received

  Object {
    "content": "",
-   "intro": "Hello World!",
+   "intro": "",
  }

 ❯ tests/useMultiRootEditor.test.tsx:951:57
    949|     await waitFor( () => {
    950|      expect( result.current.editor ).to.be.instanceof( SlowEditor );
    951|      expect( result.current.editor!.data.get() ).to.deep.equal( {
       |                                                         ^
    952|       intro: 'Hello World!',
    953|       content: ''

See on CI.

it( 'should assign properly `data` property to editor even if it is still mounting', async () => {

It might be related to using timeouts:

await timeout( 100 );
result.current.setData( {
intro: 'Hello World!',
content: ''
} );
await timeout( 200 );
deferInitialization.resolve();
await waitFor( () => {
expect( result.current.editor ).to.be.instanceof( SlowEditor );
expect( result.current.editor!.data.get() ).to.deep.equal( {
intro: 'Hello World!',
content: ''
} );
} );

What's worth mentioning is that it seems it got more unstable after #534 PR got merged.

@Mati365 Mati365 linked a pull request Oct 4, 2024 that will close this issue
@f1ames
Copy link
Contributor Author

f1ames commented Oct 11, 2024

After #543, it seems this is not flaky test in fact, but really a regression from #534. Test is failing randomly still after improvements from #543 so there might be race condition or something similar going on.

@f1ames f1ames added squad:collaboration Issue to be handled by the Collaboration team. type:bug labels Oct 11, 2024
@f1ames f1ames self-assigned this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:collaboration Issue to be handled by the Collaboration team. type:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant