Skip to content

Comments

Chore: Increase Playwright test timeouts and reduce test flakiness #11970

Merged
laurent22 merged 3 commits intolaurent22:devfrom
personalizedrefrigerator:pr/chore/increase-test-timeouts
Mar 15, 2025
Merged

Chore: Increase Playwright test timeouts and reduce test flakiness #11970
laurent22 merged 3 commits intolaurent22:devfrom
personalizedrefrigerator:pr/chore/increase-test-timeouts

Conversation

@personalizedrefrigerator
Copy link
Collaborator

Summary

This pull request attempts to address recent Playwright-related test failures in CI (and locally) by increasing test timeouts.

Possible future work

At present, each test runs Joplin's database migrations to create a new profile. Creating a test profile once, then re-using a copy of it for all tests could improve test performance.

@personalizedrefrigerator personalizedrefrigerator changed the title Chore: Increase Playwright test timeouts Chore: Increase Playwright test timeouts and reduce test flakiness Mar 15, 2025
Comment on lines +121 to +122
// Work around occasional "resolved to 2 elements" errors in CI
.last();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The goal of this change is to work around the following occasional test failure:

Error: locator.waitFor: Error: strict mode violation: getByAltText('large-jpg-image-with-exif-rotation.jpg') resolved to 2 elements:
➤ YN0000: [@joplin/app-desktop]:         1) <img title="" data-from-md="" alt="large-jpg-image-with-exif-rotation.jpg" data-resource-id="3379eea703504dbfb1b949db385a0abe" src="joplin-content://note-viewer//Users/runner/work/joplin/joplin/packages/app-desktop/integration-tests/test-profile/1M2urBZZBp2RhdaiCwPMhA/resources//3379eea703504dbfb1b949db385a0abe.jpg?t=1742052371936"/> aka getByRole('img', { name: 'large-jpg-image-with-exif-' }).first()
➤ YN0000: [@joplin/app-desktop]:         2) <img title="" data-from-md="" alt="large-jpg-image-with-exif-rotation.jpg" data-resource-id="9ee801938bf84de3b1ed3210526954c3" src="joplin-content://note-viewer//Users/runner/work/joplin/joplin/packages/app-desktop/integration-tests/test-profile/1M2urBZZBp2RhdaiCwPMhA/resources//9ee801938bf84de3b1ed3210526954c3.jpg?t=1742052371811"/> aka getByRole('img', { name: 'large-jpg-image-with-exif-' }).nth(1)
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:     Call log:
➤ YN0000: [@joplin/app-desktop]:       - waiting for locator('.rli-editor').locator('iframe[src$="note-viewer/index.html"]').frameLocator(':scope').getByAltText('large-jpg-image-with-exif-rotation.jpg')
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:        at util/getImageSourceSize.ts:6
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:       4 | 	// Use state: 'attached' -- we don't need the image to be on the screen (just present
➤ YN0000: [@joplin/app-desktop]:       5 | 	// in the DOM).
➤ YN0000: [@joplin/app-desktop]:     > 6 | 	await imageLocator.waitFor({ state: 'attached' });
➤ YN0000: [@joplin/app-desktop]:         | 	                   ^
➤ YN0000: [@joplin/app-desktop]:       7 |
➤ YN0000: [@joplin/app-desktop]:       8 | 	// We load a copy of the image to avoid returning an overriden width set with
➤ YN0000: [@joplin/app-desktop]:       9 | 	//    .width = some_number

It may also make sense to check the image attachment logic to verify that it doesn't attach images to a note twice in certain cases.

@laurent22 laurent22 merged commit 7b2b3a4 into laurent22:dev Mar 15, 2025
7 checks passed
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