[java] configurable timeout for BiDi commands#16796
[java] configurable timeout for BiDi commands#16796asolntsev merged 2 commits intoSeleniumHQ:trunkfrom
Conversation
PR Compliance Guide 🔍(Compliance updated until commit 4a076f5)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 5248286
|
||||||||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
|
This is another PR trying to do this #16410 |
5248286 to
d5abda4
Compare
Hm, yes.. Just I see it has been pending for a while... My PR is smaller, it doesn't pretend to solve too many problems. Just add the timeout and use a shorter timeout in few tests to make them much faster. |
f48ffe8 to
b819dd0
Compare
b819dd0 to
fa43566
Compare
...via system property "webdriver.bidi.timeout" (default: "30"). It's similar to the existing system properties "webdriver.httpclient.connectionTimeout" (default: "10") and "webdriver.httpclient.readTimeout" (default: "180").
…t.navigate" By using a shorter timeout when opening an invalid URL, I achieved a huge speed-up for test `NetworkCommandsTest.canContinueWithoutAuthCredentials`. Now it lasts 0.2s instead of 30s!
fa43566 to
4a076f5
Compare
|
@diemol Can we merge this PR? I've moved unrelated commits to another PR, now it's very small and clear change. |
I've implemented the requested changes.
|
Why was this merged? I left a comment saying that we did not want this approach. |
… backward compatibility) This constructor disappeared in PR SeleniumHQ#16796 when `wsTimeout` parameter was added.
… backward compatibility) This constructor disappeared in PR SeleniumHQ#16796 when `wsTimeout` parameter was added.
|
For the record: because the initial comment said two things, and both are done:
|
User description
💥 What does this PR do?
BrowsingContext.navigatemethod🔄 Types of changes
PR Type
Enhancement
Description
Makes BiDi timeout configurable via system property
Adds optional timeout parameter to BiDi commands
Adds optional timeout parameter to navigate method
Speeds up tests using shorter timeouts for invalid URLs
Diagram Walkthrough
File Walkthrough
BiDi.java
Configurable BiDi timeout with command-level overridejava/src/org/openqa/selenium/bidi/BiDi.java
webdriver.bidi.timeoutwith default of 30 seconds
sendmethod accepting optionalDurationtimeoutparameter
parseLongfor parsing system property valueBrowsingContext.java
Add timeout parameter to navigate methodsjava/src/org/openqa/selenium/bidi/browsingcontext/BrowsingContext.java
navigatemethod accepting optionalDurationtimeoutparameter
navigateCommandhelper method
reuse
DurationclassBrowsingContextInspectorTest.java
Speed up navigation failure test with shorter timeoutjava/test/org/openqa/selenium/bidi/browsingcontext/BrowsingContextInspectorTest.java
canListenToNavigationFailedEventtest to use 1-second timeoutfor invalid URL navigation
BiDiExceptioninstead of generic exceptionhandling
milliseconds
currentTimeMillis,ofSeconds,MILLISECONDS, andBiDiExceptionNetworkCommandsTest.java
Speed up auth test with 200ms timeoutjava/test/org/openqa/selenium/bidi/network/NetworkCommandsTest.java
canContinueWithoutAuthCredentialstest to use 200-millisecondtimeout for invalid URL navigation
near-instant failure