Skip to content

Commit 9333aa2

Browse files
authored
[rel/17.6] Fix no-suitable provider found (#4474)
1 parent 44971e4 commit 9333aa2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,17 @@ public void DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEve
9999
// marked as NotDiscovered.
100100
_dataAggregator.MarkSourcesWithStatus(discoveryCriteria.Sources, DiscoveryStatus.NotDiscovered);
101101

102-
_parallelOperationManager.StartWork(workloads, eventHandler, GetParallelEventHandler, InitializeDiscoverTestsOnConcurrentManager, DiscoverTestsOnConcurrentManager);
102+
if (nonRunnableWorkloads.Count > 0)
103+
{
104+
// We found some sources that don't associate to any runtime provider and so they cannot run.
105+
// Mark the sources as skipped.
106+
107+
_dataAggregator.MarkSourcesWithStatus(nonRunnableWorkloads.SelectMany(w => w.Work.Sources), DiscoveryStatus.SkippedDiscovery);
108+
// TODO: in strict mode keep them as non-discovered, and mark the run as aborted.
109+
// _dataAggregator.MarkAsAborted();
110+
}
111+
112+
_parallelOperationManager.StartWork(runnableWorkloads, eventHandler, GetParallelEventHandler, InitializeDiscoverTestsOnConcurrentManager, DiscoverTestsOnConcurrentManager);
103113
}
104114

105115
private ITestDiscoveryEventsHandler2 GetParallelEventHandler(ITestDiscoveryEventsHandler2 eventHandler, IProxyDiscoveryManager concurrentManager)

src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public int StartTestRun(TestRunCriteria testRunCriteria, IInternalTestRunEventsH
115115
// _currentRunDataAggregator.MarkAsAborted();
116116
}
117117

118-
_parallelOperationManager.StartWork(workloads, eventHandler, GetParallelEventHandler, PrepareTestRunOnConcurrentManager, StartTestRunOnConcurrentManager);
118+
_parallelOperationManager.StartWork(runnableWorkloads, eventHandler, GetParallelEventHandler, PrepareTestRunOnConcurrentManager, StartTestRunOnConcurrentManager);
119119

120120
// Why 1? Because this is supposed to be a processId, and that is just the default that was chosen by someone before me,
121121
// and maybe is checked somewhere, but I don't see it checked in our codebase.

0 commit comments

Comments
 (0)