Skip to content

Commit 2acc8af

Browse files
authored
Abort when init and run messages fail to process (#2887)
* Abort when init and run messages fail to process, usually on deserialization, to prevent the host from hanging * Send the message via the abort handler when we abort the run
1 parent 1050e72 commit 2acc8af

File tree

32 files changed

+379
-81
lines changed

32 files changed

+379
-81
lines changed

Localize/lcl/cs/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[Testovací běh se přerušil s chybou {0}.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/de/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[Der Testlauf wurde mit dem Fehler {0} abgebrochen.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/es/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[La serie de pruebas se ha anulado con el error {0}.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/fr/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[Désolé... Nous n’avons pas pu procéder à la série de tests, car nous avons rencontré l’erreur suivante : {0}.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/it/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[Esecuzione dei test interrotta con errore {0}.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/ja/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[テストの実行がエラー {0} により中止されました。]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/ko/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[테스트 실행이 {0} 오류로 인해 중단되었습니다.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/pl/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[Przebieg testowy został przerwany z powodu błędu {0}.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/pt-BR/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[Execução de Teste Abortada com Erro {0}.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/ru/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,15 @@
14561456
</Str>
14571457
<Disp Icon="Str" />
14581458
</Item>
1459+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1460+
<Str Cat="Text">
1461+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1462+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1463+
<Val><![CDATA[Тестовый запуск прерван с ошибкой {0}.]]></Val>
1464+
</Tgt>
1465+
</Str>
1466+
<Disp Icon="Str" />
1467+
</Item>
14591468
<Item ItemId=";TestRunFailed" ItemType="0" PsrId="308" Leaf="true">
14601469
<Str Cat="Text">
14611470
<Val><![CDATA[Test Run Failed.]]></Val>

Localize/lcl/tr/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[Test Çalıştırması {0} hatasıyla durduruldu.]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/zh-Hans/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[测试运行已中止,出现错误 {0}。]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

Localize/lcl/zh-Hant/src/vstest.console/Resources/xlf/Resources.xlf.lcl

+9
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,15 @@
14471447
</Str>
14481448
<Disp Icon="Str" />
14491449
</Item>
1450+
<Item ItemId=";TestRunAbortedWithError" ItemType="0" PsrId="308" Leaf="true">
1451+
<Str Cat="Text">
1452+
<Val><![CDATA[Test Run Aborted with error {0}.]]></Val>
1453+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1454+
<Val><![CDATA[測試執行已中止,錯誤 {0}。]]></Val>
1455+
</Tgt>
1456+
</Str>
1457+
<Disp Icon="Str" />
1458+
</Item>
14501459
<Item ItemId=";TestRunCanceled" ItemType="0" PsrId="308" Leaf="true">
14511460
<Str Cat="Text">
14521461
<Val><![CDATA[Test Run Canceled.]]></Val>

src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ private Assembly CurrentDomainAssemblyResolve(object sender, AssemblyResolveEven
529529
{
530530
try
531531
{
532-
EqtTrace.Verbose("CurrentDomain_AssemblyResolve: Resolving assembly '{0}'.", args.Name);
532+
EqtTrace.Verbose("CurrentDomainAssemblyResolve: Resolving assembly '{0}'.", args.Name);
533533

534534
if (this.resolvedAssemblies.TryGetValue(args.Name, out assembly))
535535
{

src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)
106106

107107
if (this.searchDirectories == null || this.searchDirectories.Count == 0)
108108
{
109+
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: There are no search directories, returning.", args.Name);
109110
return null;
110111
}
111112

@@ -146,23 +147,31 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)
146147
continue;
147148
}
148149

150+
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Searching in: '{1}'.", args.Name, dir);
151+
149152
foreach (var extension in SupportedFileExtensions)
150153
{
151154
var assemblyPath = Path.Combine(dir, requestedName.Name + extension);
152155
try
153156
{
154157
if (!File.Exists(assemblyPath))
155158
{
159+
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Assembly path does not exist: '{1}', returning.", args.Name, assemblyPath);
160+
156161
continue;
157162
}
158163

159164
AssemblyName foundName = this.platformAssemblyLoadContext.GetAssemblyNameFromPath(assemblyPath);
160165

161166
if (!this.RequestedAssemblyNameMatchesFound(requestedName, foundName))
162167
{
168+
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: File exists but version/public key is wrong. Try next extension.", args.Name);
169+
163170
continue; // File exists but version/public key is wrong. Try next extension.
164171
}
165172

173+
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Loading assembly '{1}'.", args.Name, assemblyPath);
174+
166175
assembly = this.platformAssemblyLoadContext.LoadAssemblyFromPath(assemblyPath);
167176
this.resolvedAssemblies[args.Name] = assembly;
168177

@@ -172,7 +181,7 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)
172181
}
173182
catch (FileLoadException ex)
174183
{
175-
EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Failed to load assembly. Reason:{1} ", args.Name, ex);
184+
EqtTrace.Error("AssemblyResolver.OnResolve: {0}: Failed to load assembly. Reason:{1} ", args.Name, ex);
176185

177186
// Re-throw FileLoadException, because this exception means that the assembly
178187
// was found, but could not be loaded. This will allow us to report a more

0 commit comments

Comments
 (0)