Skip to content

Fix selenium test flakiness#2202

Merged
carltongibson merged 1 commit intodjango:mainfrom
vladimirnani:test_wait_on_message
Dec 1, 2025
Merged

Fix selenium test flakiness#2202
carltongibson merged 1 commit intodjango:mainfrom
vladimirnani:test_wait_on_message

Conversation

@vladimirnani
Copy link
Contributor

Currently:

  1. Django renders the <strong>Total messages:</strong> <span id="messageCount">0</span>
  2. Test test_real_time_delete_message creates a new message and hits page refresh
  3. Test refreshes the page but doesnt wait for message to be handled, so renderState is not able to update the counter
  4. Test finds the existing count element and asserts that count 0 is not expected 1.

PR changes:

  • explicitly wait on window.messageHandled in js to be sure that renderState has finished.

Removes flakiness on fast machine.

Removes flakiness on fast machine
@vladimirnani vladimirnani changed the title Selenium waits on message to be handled Fix selenium test flakiness Dec 1, 2025
Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

Ok, looks sensible. Thanks!

@carltongibson carltongibson merged commit 0a4f2cb into django:main Dec 1, 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