Skip to content

Commit 61a9964

Browse files
authored
[BRT] Mitigating flaky SignalR tests (#8423)
* add the ability to skip c++ tests and skip signalr one (mitigates #8421)
1 parent 5efa1ba commit 61a9964

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

eng/targets/Cpp.Common.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<Target Name="Restore" />
1414
<Target Name="ResolveNuGetPackageAssets" />
1515
<Target Name="Test" Condition="'$(IsTestProject)' == 'true'" >
16-
<Exec Command="&quot;$(TargetPath)&quot;" />
16+
<Warning Condition="'$(TestProjectSkipReason)' != ''" Text="Skipped $(MSBuildProjectFileName): $(TestProjectSkipReason)" />
17+
<Exec Condition="'$(TestProjectSkipReason)' == ''" Command="&quot;$(TargetPath)&quot;" />
1718
</Target>
1819
</Project>

src/SignalR/clients/cpp/test/signalrclienttests/Build/VS/signalrclienttests.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,6 @@
9595
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
9696
<PropertyGroup>
9797
<IsTestProject>true</IsTestProject>
98+
<TestProjectSkipReason>Flaky, due to https://github.com/aspnet/AspNetCore/issues/8421</TestProjectSkipReason>
9899
</PropertyGroup>
99100
</Project>

src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public async Task StreamDoesNotStartIfTokenAlreadyCanceled(string protocolName,
455455
var cts = new CancellationTokenSource();
456456
cts.Cancel();
457457

458-
await Assert.ThrowsAnyAsync<OperationCanceledException>(() =>connection.StreamAsChannelAsync<int>("Stream", 5, cts.Token).OrTimeout());
458+
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => connection.StreamAsChannelAsync<int>("Stream", 5, cts.Token).OrTimeout());
459459
}
460460
catch (Exception ex)
461461
{

0 commit comments

Comments
 (0)