-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parallel discovery #3437
Fix parallel discovery #3437
Conversation
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs
Outdated
Show resolved
Hide resolved
@@ -21,13 +20,13 @@ public void AggregateShouldAggregateAbortedCorrectly() | |||
{ | |||
var aggregator = new ParallelDiscoveryDataAggregator(); | |||
|
|||
aggregator.Aggregate(totalTests: 5, isAborted: false); | |||
aggregator.Aggregate(new(totalTests: 5, isAborted: false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be too tired today, but what is the change in syntax? is that going from method call with parameters to, method call that takes a single object, which has non-default constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aggregate used to take 2 args (total tests and is aborted), now it takes the event arg (that has an overload with the previous 2 args).
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs
Outdated
Show resolved
Hide resolved
a8561c8
to
0d22ead
Compare
src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.ObjectModel/Client/Events/DiscoveryCompleteEventArgs.cs
Show resolved
Hide resolved
I still need to make some manual tests before we merge this PR. |
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs
Outdated
Show resolved
Hide resolved
f2f9030
to
c77fed8
Compare
@@ -1,9 +1,6 @@ | |||
// Copyright (c) Microsoft Corporation. All rights reserved. | |||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | |||
|
|||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to this file are unrelated to this PR but fixes the failing acceptance tests that were blocking this PR.
@@ -2,6 +2,7 @@ | |||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | |||
|
|||
using System; | |||
using System.IO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to this file are unrelated to this PR but fixes the failing acceptance tests that were blocking this PR.
@@ -1,13 +1,12 @@ | |||
// Copyright (c) Microsoft Corporation. All rights reserved. | |||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | |||
|
|||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to this file are unrelated to this PR but fixes the failing acceptance tests that were blocking this PR.
@@ -8,8 +8,6 @@ | |||
using Microsoft.TestPlatform.TestUtilities; | |||
using Microsoft.VisualStudio.TestTools.UnitTesting; | |||
|
|||
#nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to this file are unrelated to this PR but fixes the failing acceptance tests that were blocking this PR.
@@ -6,11 +6,12 @@ | |||
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" /> | |||
<PropertyGroup> | |||
<AssemblyName>Microsoft.VisualStudio.TestPlatform.Common</AssemblyName> | |||
<TargetFrameworks>netstandard2.0;netstandard1.3;net451</TargetFrameworks> | |||
<TargetFrameworks>netstandard2.0;netstandard1.3;net451;net6.0</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding net6.0 because I need a TFM greater or equal to netcoreapp3.0 so that we have a dll where NullableAttributes.cs
is not included. Otherwise we get an error that says the attribute comes from 2 locations (system and this). I am using net6.0 because we are already targeting this for DotNetBuildFromSource
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm. This is not being shipped in any of our Nugets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just double checked and running build.cmd locally doesn't produce the net6.0 of the dll in the artifacts folder.
|
||
namespace Microsoft.TestPlatform; | ||
|
||
[SuppressMessage("ApiDesign", "RS0030:Do not used banned APIs", Justification = "Replacement API to allow nullable hints for compiler")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could remove this because I haven't yet banned the other symbol but keeping it would simplify merge for later changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it.
namespace Microsoft.TestPlatform; | ||
|
||
[SuppressMessage("ApiDesign", "RS0030:Do not used banned APIs", Justification = "Replacement API to allow nullable hints for compiler")] | ||
internal static class Debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am always forcing this one but FYI in recent versions the system Debug.Assert
methods already support it.
// This event is always raised from the client side, while the total count of tests is maintained | ||
// only at the testhost end. In case of a discovery abort (various reasons including crash), it is | ||
// not possible to get a list of total tests from testhost. Hence we enforce a -1 count. | ||
Debug.Assert((!isAborted || -1 == totalTests), "If discovery request is aborted totalTest should be -1."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove this comment because we are now also using this event args inside the parallel discovery.
/// <param name="fullyDiscoveredSources">List of fully discovered sources</param> | ||
/// <param name="partiallyDiscoveredSources">List of partially discovered sources</param> | ||
/// <param name="notDiscoveredSources">List of not discovered sources</param> | ||
public DiscoveryCompleteEventArgs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cvpoienaru added a new ctor with this signature + the extensions dictionary but this public ctor is not yet released so we can just go with only one overload.
@@ -6,11 +6,12 @@ | |||
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" /> | |||
<PropertyGroup> | |||
<AssemblyName>Microsoft.VisualStudio.TestPlatform.Common</AssemblyName> | |||
<TargetFrameworks>netstandard2.0;netstandard1.3;net451</TargetFrameworks> | |||
<TargetFrameworks>netstandard2.0;netstandard1.3;net451;net6.0</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm. This is not being shipped in any of our Nugets?
|
||
namespace Microsoft.TestPlatform; | ||
|
||
[SuppressMessage("ApiDesign", "RS0030:Do not used banned APIs", Justification = "Replacement API to allow nullable hints for compiler")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it.
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…allelDiscoveryDataAggregator.cs Co-authored-by: Jakub Jareš <me@jakubjares.com>
54b6887
to
63b1c1e
Compare
Description
The previously merged #3349 PR wasn't handling parallel discovery correctly for all cases.
Related issue
Fixes AB#1493062
Replaces #3435