Skip to content

Commit

Permalink
Fixed incorrect timeout message when test host crashes/exits (#2056)
Browse files Browse the repository at this point in the history
* Fixed incorrect timeout message when test host crashes/exits

* Added tests

* Update ProxyExecutionManagerTests.cs

* Update ProxyOperationManager.cs

* Update ProxyExecutionManagerTests.cs
  • Loading branch information
ShreyasRmsft committed Jun 19, 2019
1 parent e4f6d05 commit 4c09f19
Show file tree
Hide file tree
Showing 57 changed files with 199 additions and 302 deletions.
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Proces testovacího hostitele se chybově ukončil.</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Der Testhostprozess ist abgestürzt.</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Proceso de host de pruebas bloqueado</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Plantage du processus hôte de test</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Arresto anomalo del processo host di test</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">テストのホスト プロセスがクラッシュしました</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">테스트 호스트 프로세스 작동이 중단됨</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Wystąpiła awaria procesu hosta testu</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Falha no processo do host de teste</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Сбой хост-процесса теста</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">Test ana işlemi kilitlendi</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">测试主机进程崩溃</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -79,8 +79,7 @@
<trans-unit id="TestHostProcessCrashed">
<source>Test host process crashed</source>
<target state="translated">測試主機處理序當機</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -160,7 +160,15 @@ public virtual bool SetupChannel(IEnumerable<string> sources)
if (!this.testHostLaunched ||
!this.RequestSender.WaitForRequestHandlerConnection(connTimeout * 1000, this.CancellationTokenSource.Token))
{
// Throw a test platform exception with the appropriate message if user requested cancellation
this.CancellationTokenSource.Token.ThrowTestPlatformExceptionIfCancellationRequested();

// Throw a test platform exception along with the error messages from the test if the test host exited unexpectedly
// before communication was established
this.ThrowOnTestHostExited(this.testHostExited.IsSet);

// Throw a test platform exception stating the connection to test could not be established even after waiting
// for the configure timeout period
this.ThrowExceptionOnConnectionFailure(connTimeout);
}

Expand Down Expand Up @@ -306,6 +314,14 @@ private void TestHostManagerHostExited(object sender, HostProviderEventArgs e)
this.testHostExited.Set();
}

private void ThrowOnTestHostExited(bool testHostExited)
{
if (testHostExited)
{
throw new TestPlatformException(string.Format(CrossPlatEngineResources.TestHostExitedWithError, this.testHostProcessStdError));
}
}

private void ThrowExceptionOnConnectionFailure(int connTimeout)
{
// Failed to launch testhost process.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -169,7 +169,7 @@
<value>Logging TestHost Diagnostics in file: {0}</value>
</data>
<data name="TestHostExitedWithError" xml:space="preserve">
<value>Testhost process exited with error: {0}</value>
<value>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</value>
</data>
<data name="TestRunFailed_NoDiscovererFound_NoTestsAreAvailableInTheSources" xml:space="preserve">
<value>No test is available in {0}. Make sure that test discoverer &amp; executors are registered and platform &amp; framework version settings are appropriate and try again.</value>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Proces hostitele testu se ukončil s chybou: {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Proces hostitele testu se ukončil s chybou: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Der Testhostprozess wurde mit dem Fehler {0} beendet.</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Der Testhostprozess wurde mit dem Fehler {0} beendet.</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">El proceso del host de pruebas se cerró con el error {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">El proceso del host de pruebas se cerró con el error {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Le processus testhost s'est arrêté avec l'erreur : {0}.</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Le processus testhost s'est arrêté avec l'erreur : {0}.</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Il processo host dei test è terminato con l'errore {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Il processo host dei test è terminato con l'errore {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Testhost プロセスが次のエラーにより終了しました: {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost プロセスが次のエラーにより終了しました: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Testhost 프로세스가 종료되었습니다(오류: {0}).</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost 프로세스가 종료되었습니다(오류: {0}).</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Proces testhost zakończył się z błędem: {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Proces testhost zakończył się z błędem: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Processo de testhood encerrado com erro: {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Processo de testhood encerrado com erro: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Процесс testhost завершен с ошибкой {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Процесс testhost завершен с ошибкой {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Testhost işleminden hata ile çıkıldı: {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost işleminden hata ile çıkıldı: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -64,7 +64,7 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost process exited with error: {0}</target>
<note></note>
</trans-unit>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Testhost 进程已退出,并显示错误: {0}。</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost 进程已退出,并显示错误: {0}。</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -153,9 +153,9 @@
<note />
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}</source>
<target state="translated">Testhost 處理序已結束。錯誤: {0}</target>
<note />
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost 處理序已結束。錯誤: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Expand Up @@ -59,8 +59,7 @@
<trans-unit id="InvalidFilePath">
<source>File {0} does not exists</source>
<target state="translated">Soubor {0} neexistuje.</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -59,8 +59,7 @@
<trans-unit id="InvalidFilePath">
<source>File {0} does not exists</source>
<target state="translated">Die Datei "{0}" ist nicht vorhanden.</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -59,8 +59,7 @@
<trans-unit id="InvalidFilePath">
<source>File {0} does not exists</source>
<target state="translated">El archivo {0} no existe</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -59,8 +59,7 @@
<trans-unit id="InvalidFilePath">
<source>File {0} does not exists</source>
<target state="translated">Le fichier {0} n'existe pas</target>
<note>
</note>
<note></note>
</trans-unit>
</body>
</file>
Expand Down

0 comments on commit 4c09f19

Please sign in to comment.