Skip to content

Commit

Permalink
E2E/CI: Port disables for flaky tests (Azure#5468)
Browse files Browse the repository at this point in the history
  • Loading branch information
and-rewsmith authored Sep 7, 2021
1 parent b4b2d7d commit cc268df
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 19 deletions.
14 changes: 11 additions & 3 deletions builds/e2e/templates/e2e-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ steps:
$testFile = '$(binDir)/Microsoft.Azure.Devices.Edge.Test.dll'
$test_type = '${{ parameters.test_type }}'
# Filter out unstable tests.
$filter = 'Category!=Unstable'
# Filter out flaky tests.
$filter = 'Category!=Flaky'
if ('$(Agent.Name)'.Contains('centos'))
{
$filter += '&Category=CentOsSafe'
}
elseif ('$(arch)' -eq 'arm32v7' -Or '$(arch)' -eq 'arm64v8')
{
$filter += '&Category!=UnstableOnArm'
$filter += '&Category!=FlakyOnArm'
}
if ($test_type -eq 'nestededge_mqtt')
Expand All @@ -26,13 +26,21 @@ steps:
$filter += '&Category!=NestedEdgeAmqpOnly'
$filter += '&Category!=LegacyMqttRequired'
$filter += '&Category!=FlakyOnNested'
# Below tests were disabled and marked for re-enable when a blocking item was resolved.
# When it was resolved the tests were never enabled. We need to re-enable these.
$filter += '&FullyQualifiedName!~Provisioning&FullyQualifiedName!~SasOutOfScope&FullyQualifiedName!~X509ManualProvision&FullyQualifiedName!~AuthorizationPolicyUpdateTest&FullyQualifiedName!~AuthorizationPolicyExplicitPolicyTest'
}
elseif ($test_type -eq 'nestededge_amqp')
{
$filter += '&Category!=SingleNodeOnly'
$filter += '&Category!=BrokerRequired'
$filter += '&Category!=FlakyOnNested'
# Below tests were disabled and marked for re-enable when a blocking item was resolved.
# When it was resolved the tests were never enabled. We need to re-enable these.
$filter += '&FullyQualifiedName!~Provisioning&FullyQualifiedName!~SasOutOfScope&FullyQualifiedName!~X509ManualProvision&FullyQualifiedName!~AuthorizationPolicyUpdateTest&FullyQualifiedName!~AuthorizationPolicyExplicitPolicyTest'
}
elseif ($test_type -eq 'nestededge_isa95')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CloudProxyTest
static readonly int EventHubMessageReceivedRetry = 10;
static readonly ILogger logger = Logger.Factory.CreateLogger(nameof(CloudProxyTest));

[Fact]
[Fact(Skip = "Flaky")]
[TestPriority(401)]
public async Task SendMessageTest()
{
Expand All @@ -53,7 +53,7 @@ public async Task SendMessageTest()
await CheckMessageInEventHub(sentMessagesByDevice, startTime);
}

[Fact]
[Fact(Skip = "Flaky")]
[TestPriority(402)]
public async Task SendMessageMultipleDevicesTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Cloud2DeviceTest
const string DeviceNamePrefix = "E2E_c2d_";
static readonly TimeSpan ClockSkewAdjustment = TimeSpan.FromSeconds(35);

[Theory]
[Theory(Skip = "Flaky")]
[TestPriority(101)]
[InlineData(TransportType.Mqtt_Tcp_Only)]
// [InlineData(TransportType.Mqtt_WebSocket_Only)] // Disabled: need a valid server cert for WebSocket to work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void Dispose()
this.logger.Dispose();
}

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
public async Task InvokeMethodOnModuleTest(ITransportSettings[] transportSettings)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public InMemoryDbStoreLimitsTest()
{
}

[Fact]
[Fact(Skip = "Flaky")]
async Task InMemoryDbStoreLimitValidationTest() => await this.StoreLimitValidationTestAsync();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async Task SendTelemetryTest(ITransportSettings[] transportSettings)
await Task.Delay(TimeSpan.FromSeconds(10));
}

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
async Task SendOneTelemetryMessageTest(ITransportSettings[] transportSettings)
{
Expand Down Expand Up @@ -114,7 +114,7 @@ async Task SendOneTelemetryMessageTest(ITransportSettings[] transportSettings)
await Task.Delay(TimeSpan.FromSeconds(10));
}

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
async Task SendTelemetryMultipleInputsTest(ITransportSettings[] transportSettings)
{
Expand Down Expand Up @@ -210,7 +210,7 @@ async Task SendLargeMessageHandleExceptionTest(ITransportSettings[] transportSet
await Task.Delay(TimeSpan.FromSeconds(10));
}

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
async Task SendTelemetryWithDelayedReceiverTest(ITransportSettings[] transportSettings)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TwinDiffE2ETest
{
const string DeviceNamePrefix = "E2E_twin_";

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
public async Task AddPropertySuccess(ITransportSettings[] transportSettings)
{
Expand Down Expand Up @@ -57,7 +57,7 @@ await this.RunTestCase(
});
}

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
public async Task OverwritePropertySuccess(ITransportSettings[] transportSettings)
{
Expand Down Expand Up @@ -94,7 +94,7 @@ await this.RunTestCase(
});
}

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
public async Task UnchangedPropertySuccess(ITransportSettings[] transportSettings)
{
Expand Down Expand Up @@ -260,7 +260,7 @@ await this.RunTestCase(
});
}

[Theory]
[Theory(Skip = "Flaky")]
[MemberData(nameof(TestSettings.TransportSettings), MemberType = typeof(TestSettings))]
public async Task OverwriteValueWithObjectSuccess(ITransportSettings[] transportSettings)
{
Expand Down
2 changes: 2 additions & 0 deletions test/Microsoft.Azure.Devices.Edge.Test/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ await TryFinally.DoAsync(
[Test]
[Category("CentOsSafe")]
[Category("NestedEdgeOnly")]
[Category("FlakyOnNested")]
public async Task QuickstartChangeSasKey()
{
CancellationToken token = this.TestToken;
Expand Down Expand Up @@ -192,6 +193,7 @@ await Profiler.Run(

[Test]
[Category("CentOsSafe")]
[Category("FlakyOnNested")]
public async Task DisableReenableParentEdge()
{
CancellationToken token = this.TestToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Devices.Edge.Test
class DeviceWithCustomCertificates : CustomCertificatesFixture
{
[Test]
[Category("Flaky")]
public async Task TransparentGateway(
[Values] TestAuthenticationType testAuth,
[Values(Protocol.Mqtt, Protocol.Amqp)] Protocol protocol)
Expand Down Expand Up @@ -75,6 +76,7 @@ await TryFinally.DoAsync(

[Test]
[Category("NestedEdgeOnly")]
[Category("FlakyOnNested")]
[Description("A test to verify a leaf device can be registered under grandparent device scope.")]
public async Task GrandparentScopeDevice(
[Values(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public async Task TestPing()
}

[Test]
[Category("Flaky")]
public async Task TestGetModuleLogs()
{
string moduleName = "NumberLogger";
Expand Down
1 change: 1 addition & 0 deletions test/Microsoft.Azure.Devices.Edge.Test/Metrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class Metrics : SasManualProvisioningFixture
public const string ModuleName = "metricsValidator";

[Test]
[Category("FlakyOnArm")]
public async Task ValidateMetrics()
{
CancellationToken token = this.TestToken;
Expand Down
1 change: 1 addition & 0 deletions test/Microsoft.Azure.Devices.Edge.Test/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public async Task TempFilter()
}

[Test]
[Category("FlakyOnArm")]
// Test Temperature Filter Function: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-function
public async Task TempFilterFunc()
{
Expand Down
6 changes: 3 additions & 3 deletions test/Microsoft.Azure.Devices.Edge.Test/PriorityQueues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class PriorityQueues : SasManualProvisioningFixture
const string DefaultLoadGenTestStartDelay = "00:00:20";

[Test]
[Category("UnstableOnArm")]
[Category("FlakyOnArm")]
public async Task PriorityQueueModuleToModuleMessages()
{
CancellationToken token = this.TestToken;
Expand All @@ -55,7 +55,7 @@ public async Task PriorityQueueModuleToModuleMessages()
}

[Test]
[Category("UnstableOnArm")]
[Category("Flaky")]
public async Task PriorityQueueModuleToHubMessages()
{
CancellationToken token = this.TestToken;
Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task PriorityQueueModuleToHubMessages()
}

[Test]
[Category("UnstableOnArm")]
[Category("FlakyOnArm")]
public async Task PriorityQueueTimeToLive()
{
CancellationToken token = this.TestToken;
Expand Down
2 changes: 2 additions & 0 deletions test/Microsoft.Azure.Devices.Edge.Test/Provisioning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ string DeriveDeviceKey(byte[] groupKey, string registrationId)

[Test]
[Category("CentOsSafe")]
[Category("FlakyOnArm")]
public async Task DpsSymmetricKey()
{
string idScope = Context.Current.DpsIdScope.Expect(() => new InvalidOperationException("Missing DPS ID scope (check dpsIdScope in context.json)"));
Expand Down Expand Up @@ -80,6 +81,7 @@ await this.daemon.ConfigureAsync(
}

[Test]
[Category("FlakyOnArm")]
public async Task DpsX509()
{
(string, string, string) rootCa =
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.Azure.Devices.Edge.Test/X509Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace Microsoft.Azure.Devices.Edge.Test
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Edge.Test.Common;
using Microsoft.Azure.Devices.Edge.Test.Common.Certs;
using Microsoft.Azure.Devices.Edge.Test.Common.Config;
using Microsoft.Azure.Devices.Edge.Test.Helpers;
using Microsoft.Azure.Devices.Edge.Util;
Expand All @@ -17,6 +16,7 @@ namespace Microsoft.Azure.Devices.Edge.Test
class X509Device : X509ManualProvisioningFixture
{
[Test]
[Category("Flaky")]
public async Task X509ManualProvision()
{
CancellationToken token = this.TestToken;
Expand Down

0 comments on commit cc268df

Please sign in to comment.