Skip to content

Commit 031cd31

Browse files
authored
Fixing the connection timeout (#1910)
* Fix the connection timeout for design mode client and socket communication manager.
1 parent b7b6283 commit 031cd31

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ public void ConnectToClientAndProcessRequests(int port, ITestRequestManager test
9595
EqtTrace.Info("Trying to connect to server on port : {0}", port);
9696
this.communicationManager.SetupClientAsync(new IPEndPoint(IPAddress.Loopback, port));
9797

98-
var connectionTimeout = EnvironmentHelper.GetConnectionTimeout();
98+
var connectionTimeoutInSecs = EnvironmentHelper.GetConnectionTimeout();
9999

100100
// Wait for the connection to the server and listen for requests.
101-
if (this.communicationManager.WaitForServerConnection(connectionTimeout))
101+
if (this.communicationManager.WaitForServerConnection(connectionTimeoutInSecs * 1000))
102102
{
103103
this.communicationManager.SendMessage(MessageType.SessionConnected);
104104
this.ProcessRequests(testRequestManager);
@@ -113,7 +113,7 @@ public void ConnectToClientAndProcessRequests(int port, ITestRequestManager test
113113
CommunicationUtilitiesResources.ConnectionTimeoutErrorMessage,
114114
CoreUtilitiesConstants.VstestConsoleProcessName,
115115
"translation layer",
116-
connectionTimeout,
116+
connectionTimeoutInSecs,
117117
EnvironmentHelper.VstestConnectionTimeout)
118118
);
119119
}

src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public async Task SetupClientAsync(IPEndPoint endpoint)
172172

173173
Stopwatch watch = new Stopwatch();
174174
watch.Start();
175-
var connectionTimeout = EnvironmentHelper.GetConnectionTimeout();
175+
var connectionTimeout = EnvironmentHelper.GetConnectionTimeout() * 1000;
176176
do
177177
{
178178
try

0 commit comments

Comments
 (0)