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

test/common: don't reuse webdriver ids on exceptions #21608

Merged

Conversation

allisonkarlitskaya
Copy link
Member

We use a self.last_id field to issue unique IDs for each async request we send to the browser, but only increment the ID after we get a successful reply. That breaks in situations where we get no reply, or an exception occurs.

Sample the ID at the start and increment it immediately before awaiting anything.

We use a `self.last_id` field to issue unique IDs for each async request
we send to the browser, but only increment the ID after we get a
successful reply.  That breaks in situations where we get no reply, or
an exception occurs.

Sample the ID at the start and increment it immediately before
`await`ing anything.
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! Bit of a "should not happen", but it's nicer anyway.

@allisonkarlitskaya
Copy link
Member Author

Thanks! Bit of a "should not happen", but it's nicer anyway.

eh, I noticed it because it did happen...

...in response to a bug in Firefox, but still...

@martinpitt
Copy link
Member

Right, that's what I meant -- BiDi command not getting a response is the "should not happen" (but did anyway). Hence this is a nice robustification. Thanks for fixing!

@allisonkarlitskaya allisonkarlitskaya merged commit 91bf28a into cockpit-project:main Feb 11, 2025
82 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the reuse-async-id branch February 11, 2025 14:17
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