From a21bedcf78057e179a2d7336c3dc9d6db900ed98 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:33:38 +0300 Subject: [PATCH 1/2] [dotnet] Don't write trace log message when waiting until driver service is initialized On CI execution we see a lot of exceptions logged to output. Given that timeout is 5 seconds only, it is good just to suppress these exceptions even in internal logs. --- dotnet/src/webdriver/DriverService.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dotnet/src/webdriver/DriverService.cs b/dotnet/src/webdriver/DriverService.cs index a061bee8594cb..2ce3c294fd825 100644 --- a/dotnet/src/webdriver/DriverService.cs +++ b/dotnet/src/webdriver/DriverService.cs @@ -16,7 +16,6 @@ // limitations under the License. // -using OpenQA.Selenium.Internal.Logging; using OpenQA.Selenium.Remote; using System; using System.Diagnostics; @@ -42,7 +41,6 @@ public abstract class DriverService : ICommandServer private bool isDisposed; private Process driverServiceProcess; private TimeSpan initializationTimeout = TimeSpan.FromSeconds(20); - private readonly static ILogger logger = Log.GetLogger(); /// /// Initializes a new instance of the class. @@ -238,10 +236,7 @@ protected virtual bool IsInitialized } catch (Exception ex) when (ex is HttpRequestException || ex is TaskCanceledException) { - if (logger.IsEnabled(LogEventLevel.Trace)) - { - logger.Trace(ex.ToString()); - } + // do noothing: the exception is expected, meaning driver service is not initialized } return isInitialized; From 6565b603928ca2dff02311f0cf7a981f52dc986b Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:36:26 +0300 Subject: [PATCH 2/2] Typo --- dotnet/src/webdriver/DriverService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/src/webdriver/DriverService.cs b/dotnet/src/webdriver/DriverService.cs index 2ce3c294fd825..94a100e4997e1 100644 --- a/dotnet/src/webdriver/DriverService.cs +++ b/dotnet/src/webdriver/DriverService.cs @@ -236,7 +236,7 @@ protected virtual bool IsInitialized } catch (Exception ex) when (ex is HttpRequestException || ex is TaskCanceledException) { - // do noothing: the exception is expected, meaning driver service is not initialized + // do nothing: the exception is expected, meaning driver service is not initialized } return isInitialized;