test: fix flaky should reload test fail#486
Merged
edison1105 merged 1 commit intomainfrom Dec 13, 2024
Merged
Conversation
commit: |
sapphi-red
commented
Dec 13, 2024
| test('should reload when relies file changed', async () => { | ||
| // rerender | ||
| editFile('Hmr.vue', (code) => code.replace('HMR', 'HMR updated')) | ||
| await untilUpdated(() => page.textContent('h2.hmr'), 'HMR updated') |
Member
Author
There was a problem hiding this comment.
h2.hmr already contained HMR updated because it was updated at
vite-plugin-vue/playground/vue/__tests__/vue.spec.ts
Lines 175 to 176 in 3f55553
So this
untilUpdated asserted nothing.
That made editFile('Hmr.vue' and editFile('Hmr.vue' to run almost the same time and caused the file-changed message to be sent in reverse order sometimes.
When the file-changed message is sent in reverse order, a renderer happens and thus the test fails.
Member
Author
|
The CI passed five times in a row. I guess this change made it stable. |
edison1105
approved these changes
Dec 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
close #485
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).