Skip to content

Commit 85714df

Browse files
Merge branch 'trunk' into exception-test
2 parents 98889cc + 60e3171 commit 85714df

File tree

19 files changed

+229
-247
lines changed

19 files changed

+229
-247
lines changed

Rakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,11 @@ namespace :py do
582582
desc 'Update Python version'
583583
task :version, [:version] do |_task, arguments|
584584
old_version = python_version
585-
nightly = ".dev#{Time.now.strftime('%Y%m%d%H%M')}"
585+
nightly = ".#{Time.now.strftime('%Y%m%d%H%M')}"
586586
new_version = updated_version(old_version, arguments[:version], nightly)
587587

588588
['py/setup.py',
589+
'py/pyproject.toml',
589590
'py/BUILD.bazel',
590591
'py/selenium/__init__.py',
591592
'py/selenium/webdriver/__init__.py',
@@ -1138,7 +1139,7 @@ def updated_version(current, desired = nil, nightly = nil)
11381139
desired.split('.').tap { |v| v << 0 while v.size < 3 }.join('.')
11391140
elsif current.split(/\.|-/).size > 3
11401141
# if current version is already nightly, just need to bump it; this will be noop for some languages
1141-
pattern = /-?\.?(nightly|SNAPSHOT|dev)\d*$/
1142+
pattern = /-?\.?(nightly|SNAPSHOT|dev|\d{12})\d*$/
11421143
current.gsub(pattern, nightly)
11431144
elsif current.split(/\.|-/).size == 3
11441145
# if current version is not nightly, need to bump the version and make nightly

dotnet/src/webdriver/Firefox/FirefoxDriver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ public DevToolsSession GetDevToolsSession(int devToolsProtocolVersion)
413413
/// Creates a session to communicate with a browser using a Developer Tools debugging protocol.
414414
/// </summary>
415415
/// <returns>The active session to use to communicate with the Developer Tools debugging protocol.</returns>
416+
[Obsolete("CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi.")]
416417
public DevToolsSession GetDevToolsSession(DevToolsOptions options)
417418
{
418419
if (this.devToolsSession == null)

dotnet/src/webdriver/Remote/RemoteWebDriver.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.Internal.Logging;
2021
using OpenQA.Selenium.DevTools;
2122
using System;
2223
using System.Collections.Generic;
@@ -63,6 +64,8 @@ namespace OpenQA.Selenium.Remote
6364
/// </example>
6465
public class RemoteWebDriver : WebDriver, IDevTools, IHasDownloads
6566
{
67+
private static readonly ILogger _logger = OpenQA.Selenium.Internal.Logging.Log.GetLogger(typeof(RemoteWebDriver));
68+
6669
/// <summary>
6770
/// The name of the Selenium grid remote DevTools end point capability.
6871
/// </summary>
@@ -425,6 +428,14 @@ public ReadOnlyCollection<IWebElement> FindElementsByCssSelector(string cssSelec
425428
/// <returns>The active session to use to communicate with the Developer Tools debugging protocol.</returns>
426429
public DevToolsSession GetDevToolsSession()
427430
{
431+
if (this.Capabilities.GetCapability(CapabilityType.BrowserName) == "firefox")
432+
{
433+
if (_logger.IsEnabled(LogEventLevel.Warn))
434+
{
435+
_logger.Warn("CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi.");
436+
}
437+
}
438+
428439
return GetDevToolsSession(new DevToolsOptions() { ProtocolVersion = DevToolsSession.AutoDetectDevToolsProtocolVersion });
429440
}
430441

java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,7 @@ public boolean retryAddToQueue(SessionRequest request) {
300300
// return true to avoid handleNewSessionRequest to call 'complete' an other time
301301
return true;
302302
} else if (data.isCanceled()) {
303-
complete(
304-
request.getRequestId(),
305-
Either.left(new SessionNotCreatedException("Client has gone away")));
303+
failDueToCanceled(request.getRequestId());
306304
// return true to avoid handleNewSessionRequest to call 'complete' an other time
307305
return true;
308306
}
@@ -370,7 +368,18 @@ public List<SessionRequest> getNextAvailable(Map<Capabilities, Long> stereotypes
370368
.limit(batchSize)
371369
.collect(Collectors.toList());
372370

373-
availableRequests.forEach(req -> this.remove(req.getRequestId()));
371+
availableRequests.removeIf(
372+
(req) -> {
373+
Data data = this.requests.get(req.getRequestId());
374+
375+
if (data.isCanceled()) {
376+
failDueToCanceled(req.getRequestId());
377+
return true;
378+
}
379+
380+
this.remove(req.getRequestId());
381+
return false;
382+
});
374383

375384
return availableRequests;
376385
} finally {
@@ -458,6 +467,11 @@ private void failDueToTimeout(RequestId reqId) {
458467
complete(reqId, Either.left(new SessionNotCreatedException("Timed out creating session")));
459468
}
460469

470+
private void failDueToCanceled(RequestId reqId) {
471+
// this error should never reach the client, as this is a client initiated state
472+
complete(reqId, Either.left(new SessionNotCreatedException("Client has gone away")));
473+
}
474+
461475
private class Data {
462476

463477
public final Instant endTime;

java/test/org/openqa/selenium/environment/webserver/NettyAppServer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,16 @@ public void start() {
149149
() -> {
150150
server.start();
151151
if (secure != null) {
152-
secure.start();
152+
try {
153+
secure.start();
154+
} catch (Exception e) {
155+
try {
156+
server.stop();
157+
} catch (Exception ex) {
158+
e.addSuppressed(ex);
159+
throw e;
160+
}
161+
}
153162
}
154163
});
155164
}

py/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ compile_pip_requirements(
6262
],
6363
)
6464

65-
SE_VERSION = "4.27.0.dev202410311942"
65+
SE_VERSION = "4.27.0.202410311942"
6666

6767
BROWSER_VERSIONS = [
6868
"v85",

py/docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
# The short X.Y version.
5959
version = '4.27'
6060
# The full version, including alpha/beta/rc tags.
61-
release = '4.27.0.dev202410311942'
61+
release = '4.27.0.202410311942'
6262

6363
# The language for content autogenerated by Sphinx. Refer to documentation
6464
# for a list of supported languages.

py/pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "selenium"
7-
version = "4.27.0.dev202410311942"
7+
version = "4.27.0.202410311942"
88
license = "Apache 2.0"
99
description = "Official Python bindings for Selenium WebDriver."
1010
readme = "README.rst"
@@ -52,15 +52,15 @@ SourceCode = "https://github.com/SeleniumHQ/selenium/tree/trunk/py"
5252

5353
[tool.setuptools.package-data]
5454
selenium_package = [
55-
"*.py",
55+
"*.py",
5656
"*.rst",
57-
"*.json",
58-
"*.xpi",
57+
"*.json",
58+
"*.xpi",
5959
"*.js",
6060
"py.typed",
6161
"prune*",
6262
"selenium.egg-info*",
63-
"selenium-manager",
63+
"selenium-manager",
6464
"selenium-manager.exe",
6565
"CHANGES",
6666
"LICENSE"

py/selenium/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
# under the License.
1717

1818

19-
__version__ = "4.27.0.dev202410311942"
19+
__version__ = "4.27.0.202410311942"

py/selenium/webdriver/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from .wpewebkit.service import Service as WPEWebKitService # noqa
4545
from .wpewebkit.webdriver import WebDriver as WPEWebKit # noqa
4646

47-
__version__ = "4.27.0.dev202410311942"
47+
__version__ = "4.27.0.202410311942"
4848

4949
# We need an explicit __all__ because the above won't otherwise be exported.
5050
__all__ = [

0 commit comments

Comments
 (0)