From 031cd319cdbcb3ea770e4fb832e7b2b1a67d32dd Mon Sep 17 00:00:00 2001 From: Sarabjot Singh Date: Sun, 3 Feb 2019 19:33:16 +0530 Subject: [PATCH] Fixing the connection timeout (#1910) * Fix the connection timeout for design mode client and socket communication manager. --- .../DesignMode/DesignModeClient.cs | 6 +++--- .../SocketCommunicationManager.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs index c02675df99..bdf1c383ad 100644 --- a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs +++ b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs @@ -95,10 +95,10 @@ public void ConnectToClientAndProcessRequests(int port, ITestRequestManager test EqtTrace.Info("Trying to connect to server on port : {0}", port); this.communicationManager.SetupClientAsync(new IPEndPoint(IPAddress.Loopback, port)); - var connectionTimeout = EnvironmentHelper.GetConnectionTimeout(); + var connectionTimeoutInSecs = EnvironmentHelper.GetConnectionTimeout(); // Wait for the connection to the server and listen for requests. - if (this.communicationManager.WaitForServerConnection(connectionTimeout)) + if (this.communicationManager.WaitForServerConnection(connectionTimeoutInSecs * 1000)) { this.communicationManager.SendMessage(MessageType.SessionConnected); this.ProcessRequests(testRequestManager); @@ -113,7 +113,7 @@ public void ConnectToClientAndProcessRequests(int port, ITestRequestManager test CommunicationUtilitiesResources.ConnectionTimeoutErrorMessage, CoreUtilitiesConstants.VstestConsoleProcessName, "translation layer", - connectionTimeout, + connectionTimeoutInSecs, EnvironmentHelper.VstestConnectionTimeout) ); } diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs index 34cc1a21da..50d19c7687 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs @@ -172,7 +172,7 @@ public async Task SetupClientAsync(IPEndPoint endpoint) Stopwatch watch = new Stopwatch(); watch.Start(); - var connectionTimeout = EnvironmentHelper.GetConnectionTimeout(); + var connectionTimeout = EnvironmentHelper.GetConnectionTimeout() * 1000; do { try