[py] terminate driver service process when start() fails to connect#17651
Conversation
Review Summary by QodoTerminate driver service process when start() fails to connect
WalkthroughsDescription• Wraps Service.start() connection loop in try-except to terminate process on failure • Ensures driver process cleanup when connection cannot be established • Adds unit test verifying process termination on connection timeout Diagramflowchart LR
A["Service.start() called"] --> B["Launch process"]
B --> C["Try connection loop"]
C --> D{Connection successful?}
D -->|Yes| E["Return successfully"]
D -->|No| F["Exception raised"]
F --> G["Catch exception"]
G --> H["Call stop() to terminate"]
H --> I["Re-raise exception"]
File Changes1. py/selenium/webdriver/common/service.py
|
Code Review by Qodo
1. Cleanup shutdown lacks timeout
|
2d2f70f to
1fcc88a
Compare
|
Code review by qodo was updated up to the latest commit 1fcc88a |
1fcc88a to
60fc0c7
Compare
|
Code review by qodo was updated up to the latest commit 60fc0c7 |
🔗 Related Issues
Spotted by the Code Review agent in #17649.
💥 What does this PR do?
Service.start()left the launched driver process running if it never became connectable. This terminates it before re-raising.🔧 Implementation Notes
Fixed in base
Service.start()so all bindings' drivers are covered in one place. No API change. New unit test fails without the fix, passes with it.🤖 AI assistance
start()cleanup and the unit test🔄 Types of changes