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

RichTextEditorMentionListbox test intermittent with error No selection range exists #2219

Closed
rajsite opened this issue Jun 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@rajsite
Copy link
Member

rajsite commented Jun 26, 2024

🐛 Bug Report

The test RichTextEditorMentionListbox Dynamically update mention popup items based on configuration changes should show mention popup for multiple mention configuration elements FAILED is intermittent and fails with the error message:

InvalidStateError: Selection.collapseToEnd: No selection range exists thrown

Update: same error seen on test Markdown serializer Serialize rich text editor content to its respective markdown Mention node in this build. That test is now disabled as well.

💻 Repro or Code Sample

See build https://github.com/ni/nimble/actions/runs/9686770115/job/26729936486#step:17:411

💁 Possible Solution

Seems like it may be related to a similar sounding error from #2200

@rajsite rajsite added bug Something isn't working triage New issue that needs to be reviewed labels Jun 26, 2024
@rajsite
Copy link
Member Author

rajsite commented Jun 26, 2024

@vivinkrishna-ni could you create a corresponding AzDo issue to track this intermittent test failure? It seems like it may be similar to the type of failure covered in #2200.

rajsite added a commit that referenced this issue Jun 26, 2024
# Pull Request

## 🤨 Rationale

The test `RichTextEditorMentionListbox Dynamically update mention popup
items based on configuration changes should show mention popup for
multiple mention configuration elements` is intermittent on main and
being disabled.

See  #2219

## 👩‍💻 Implementation

Disabled the test.

## 🧪 Testing

Rely on CI.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
@vivinkrishna-ni
Copy link
Contributor

vivinkrishna-ni commented Jun 27, 2024

Created an AzDo bug: Bug 2787273: Intermittent failures in Rich Text Editor for Mention support

Last time (in #2200), it was evident that the editor was not focused at the time of committing the mention node and was failing in local with some conditions. This time, it is a rare occurrence where I ran tests in a loop for about a thousand times, ran the test with the test than ran before in the failed pipeline, and set a breakpoint at the line where the error was thrown in Tiptap. However, I still couldn't reproduce the same failure.

@m-akinc m-akinc removed the triage New issue that needs to be reviewed label Jul 2, 2024
m-akinc added a commit that referenced this issue Jul 11, 2024
# Pull Request

## 🤨 Rationale
Test failed in [this PR
build](https://github.com/ni/nimble/actions/runs/9897035682/job/27340606528?pr=2242).
Following intermittent test protocol.

```
[test-concurrent:nimble-components] [test-firefox:verbose]   Markdown serializer
[test-concurrent:nimble-components] [test-firefox:verbose]     Serialize rich text editor content to its respective markdown
[test-concurrent:nimble-components] [test-firefox:verbose]       ✗ Mention node (336ms)
[test-concurrent:nimble-components] [test-firefox:verbose] 	InvalidStateError: Selection.collapseToEnd: No selection range exists thrown
```

## 👩‍💻 Implementation

Disabled test and linked to existing issue #2219

## 🧪 Testing

N/A

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
@rajsite
Copy link
Member Author

rajsite commented Jul 11, 2024

@vivinkrishna-ni an additional test failed with the same error message and was disabled in #2262

rajsite pushed a commit that referenced this issue Oct 14, 2024
# Pull Request

## 🤨 Rationale

**Issue**: [#2219](#2219)

We are re-enabling tests that were previously disabled due to
intermittent failures and disabling only in the Firefox environment, as
the issue occurred only once during four days of testing. Additionally,
there were other cases that are validating the same mention workflow,
which has been successfully running in Firefox.

After conducting tests in a loop environment on GitHub agents, the tests
did not fail with the same error.

Please refer to the bug discussion for all the pipeline checks: [Bug
2787273](https://dev.azure.com/ni/DevCentral/_workitems/edit/2787273) -
Intermittent failures in the Rich Text Editor for Mention support.

Following this, we will monitor for any related failures and have
created a [TD](#2404) to track the
skipped Firefox browser tests.

## 👩‍💻 Implementation

Re-enabled the disabled test case.

Update:
1. For test `should show mention popup for multiple mention
configuration elements`:
1. Instead of committing the `@` mention node, remove the `@` and add
`!` to verify other mention type list options and popup visibility.
2. The test can now verify the list options for multiple mentions by
opening the popup.
1. For test `Serialize rich text editor content to its respective
markdown Mention node`:
1. Update the `clickMentionListboxOption` to focus on the editor before
committing the mention from the list options.
1. Update other methods that modify the content of the editor to also
receive focus to the editor to ensure any other intermittencies.
1. Update the `isMentionListboxOpened` method to read from the `hidden`
property and also wait before reading to resolve the intermittent
failures on Firefox when running in loop.

See the discussion below for more details,
#2403 (comment)

## 🧪 Testing

NA

## ✅ Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.

---------

Co-authored-by: Vivin Krishna <123377523+vivinkrishna-ni@users.noreply.github.com>
@vivinkrishna-ni
Copy link
Contributor

Closing the issue as the test failures are fixed as part of #2403. Please feel free to reopen the issue if the same tests are failing again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants