Let firefox choose the bidi port by default #15727
Merged
+12
−19
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.
User description
If the user hasn't asked for a specific port then just let firefox choose a random one.
🔗 Related Issues
Fixes #15707.
💥 What does this PR do?
Prevents race conditions choosing a bidi port by letting firefox choose.
🔧 Implementation Notes
Implementation is as suggested in #15707 (comment).
💡 Additional Considerations
None.
🔄 Types of changes
PR Type
Bug fix, Tests
Description
Let Firefox choose BiDi port by default to avoid race conditions
Update service initialization to use '--websocket-port=0' unless specified
Remove and revise tests for websocket port assignment logic
Add new unit tests for argument handling in service initialization
Changes walkthrough 📝
service.rb
Default to Firefox-chosen BiDi port in service initialization
rb/lib/selenium/webdriver/firefox/service.rb
service_spec.rb
Remove integration test for random websocket port assignment
rb/spec/integration/selenium/webdriver/firefox/service_spec.rb
service_spec.rb
Revise and add unit tests for websocket port argument handling
rb/spec/unit/selenium/webdriver/firefox/service_spec.rb