Skip to content

Commit 1af2f94

Browse files
committed
Ignore more tests that rely on timing. Enable tests that usually fail due to disk space issues
1 parent 06399a8 commit 1af2f94

10 files changed

+26
-7
lines changed

source/Octopus.Tentacle.Tests.Integration/ClientFileTransferRetriesTimeout.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Octopus.Tentacle.Tests.Integration.Common.Builders.Decorators;
1212
using Octopus.Tentacle.Tests.Integration.Support;
1313
using Octopus.Tentacle.Tests.Integration.Support.ExtensionMethods;
14+
using Octopus.Tentacle.Tests.Integration.Support.TestAttributes;
1415
using Octopus.Tentacle.Tests.Integration.Util;
1516
using Octopus.Tentacle.Tests.Integration.Util.Builders;
1617
using Octopus.Tentacle.Tests.Integration.Util.Builders.Decorators;
@@ -24,6 +25,7 @@ namespace Octopus.Tentacle.Tests.Integration
2425
/// from RPC calls when they are being retried and the rpc timeout period elapses.
2526
/// </summary>
2627
[IntegrationTestTimeout]
28+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
2729
public class ClientFileTransferRetriesTimeout : IntegrationTest
2830
{
2931
readonly TimeSpan retryIfRemainingDurationAtLeastBuffer = TimeSpan.FromSeconds(1);

source/Octopus.Tentacle.Tests.Integration/ClientFileTransfersAreNotRetriedWhenRetriesAreDisabled.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
using Octopus.Tentacle.Contracts.ClientServices;
88
using Octopus.Tentacle.Tests.Integration.Common.Builders.Decorators;
99
using Octopus.Tentacle.Tests.Integration.Support;
10+
using Octopus.Tentacle.Tests.Integration.Support.TestAttributes;
1011
using Octopus.Tentacle.Tests.Integration.Util.Builders;
1112
using Octopus.Tentacle.Tests.Integration.Util.Builders.Decorators;
1213
using Octopus.Tentacle.Tests.Integration.Util.TcpTentacleHelpers;
1314

1415
namespace Octopus.Tentacle.Tests.Integration
1516
{
1617
[IntegrationTestTimeout]
18+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
1719
public class ClientFileTransfersAreNotRetriedWhenRetriesAreDisabled : IntegrationTest
1820
{
1921
[Test]

source/Octopus.Tentacle.Tests.Integration/ClientFileTransfersAreRetriedWhenRetriesAreEnabled.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Octopus.Tentacle.Tests.Integration.Common.Builders.Decorators;
1111
using Octopus.Tentacle.Tests.Integration.Support;
1212
using Octopus.Tentacle.Tests.Integration.Support.ExtensionMethods;
13+
using Octopus.Tentacle.Tests.Integration.Support.TestAttributes;
1314
using Octopus.Tentacle.Tests.Integration.Util.Builders;
1415
using Octopus.Tentacle.Tests.Integration.Util.Builders.Decorators;
1516
using Octopus.Tentacle.Tests.Integration.Util.TcpTentacleHelpers;
@@ -20,6 +21,7 @@ public class ClientFileTransfersAreRetriedWhenRetriesAreEnabled : IntegrationTes
2021
{
2122
[Test]
2223
[TentacleConfigurations(testCommonVersions: true, scriptServiceToTest: ScriptServiceVersionToTest.None)]
24+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
2325
public async Task FailedUploadsAreRetriedAndIsEventuallySuccessful(TentacleConfigurationTestCase tentacleConfigurationTestCase)
2426
{
2527
await using var clientTentacle = await tentacleConfigurationTestCase.CreateBuilder()

source/Octopus.Tentacle.Tests.Integration/ClientScriptExecutionRetriesTimeout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public async Task WhenRpcRetriesTimeOut_DuringStartScript_TheRpcCallIsCancelled(
218218

219219
[Test]
220220
[TentacleConfigurations]
221-
[SkipOnEnvironmentsWithKnownPerformanceIssues]
221+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
222222
public async Task WhenStartScriptFails_AndTakesLongerThanTheRetryDuration_TheCallIsNotRetried_AndTimesOut(TentacleConfigurationTestCase tentacleConfigurationTestCase)
223223
{
224224
var retryDuration = TimeSpan.FromSeconds(15);

source/Octopus.Tentacle.Tests.Integration/ClientScriptExecutorObservesScriptObserverBackoffStrategy.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
using Octopus.Tentacle.Contracts.ClientServices;
77
using Octopus.Tentacle.Tests.Integration.Common.Builders.Decorators;
88
using Octopus.Tentacle.Tests.Integration.Support;
9+
using Octopus.Tentacle.Tests.Integration.Support.TestAttributes;
910
using Octopus.Tentacle.Tests.Integration.Util;
1011
using Octopus.Tentacle.Tests.Integration.Util.Builders;
1112
using Octopus.Tentacle.Tests.Integration.Util.Builders.Decorators;
1213

1314
namespace Octopus.Tentacle.Tests.Integration
1415
{
1516
[IntegrationTestTimeout]
17+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
1618
public class ClientScriptExecutorObservesScriptObserverBackoffStrategy : IntegrationTest
1719
{
1820
[Test]

source/Octopus.Tentacle.Tests.Integration/FileTransferServiceTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public class FileTransferServiceTests : IntegrationTest
1616
{
1717
[Test]
1818
[TentacleConfigurations(scriptServiceToTest: ScriptServiceVersionToTest.None)]
19-
[SkipOnEnvironmentsWithKnownPerformanceIssues]
2019
public async Task UploadFileSuccessfully(TentacleConfigurationTestCase tentacleConfigurationTestCase)
2120
{
2221
using var fileToUpload = new RandomTemporaryFileBuilder().Build();
@@ -44,7 +43,6 @@ public async Task UploadFileSuccessfully(TentacleConfigurationTestCase tentacleC
4443

4544
[Test]
4645
[TentacleConfigurations(scriptServiceToTest: ScriptServiceVersionToTest.None)]
47-
[SkipOnEnvironmentsWithKnownPerformanceIssues]
4846
public async Task DownloadFileSuccessfully(TentacleConfigurationTestCase tentacleConfigurationTestCase)
4947
{
5048
using var fileToDownload = new RandomTemporaryFileBuilder().Build();

source/Octopus.Tentacle.Tests.Integration/ScriptServiceV2IntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ await clientTentacle.TentacleClient.ExecuteScript(startScriptCommand, Cancellati
133133

134134
[Test]
135135
[TentacleConfigurations]
136-
[SkipOnEnvironmentsWithKnownPerformanceIssues]
136+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
137137
public async Task WhenALongRunningScriptIsCancelled_TheScriptShouldStop(TentacleConfigurationTestCase tentacleConfigurationTestCase)
138138
{
139139
await using var clientTentacle = await tentacleConfigurationTestCase.CreateBuilder()

source/Octopus.Tentacle.Tests.Integration/Support/TestAttributes/SkipOnEnvironmentsWithKnownPerformanceIssuesAttribute.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ namespace Octopus.Tentacle.Tests.Integration.Support.TestAttributes
1010
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
1111
public class SkipOnEnvironmentsWithKnownPerformanceIssuesAttribute : NUnitAttribute, IApplyToTest
1212
{
13+
string Reason { get; }
14+
15+
public SkipOnEnvironmentsWithKnownPerformanceIssuesAttribute(string reason)
16+
{
17+
Reason = reason;
18+
}
19+
1320
public void ApplyToTest(Test test)
1421
{
1522
if (test.RunState == RunState.NotRunnable || test.RunState == RunState.Ignored)
@@ -18,7 +25,7 @@ public void ApplyToTest(Test test)
1825
if (bool.TryParse(Environment.GetEnvironmentVariable("Has_Known_Performance_Issues"), out _))
1926
{
2027
test.RunState = RunState.Skipped;
21-
test.Properties.Add("_SKIPREASON", "This test only runs on environments without performance issues");
28+
test.Properties.Add("_SKIPREASON", $"This test only runs on environments without performance issues because {Reason}");
2229
}
2330
}
2431
}

source/Octopus.Tentacle.Tests.Integration/TentacleCommandLineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace Octopus.Tentacle.Tests.Integration
2828
/// Please review any changes to the assertions made by these tests carefully.
2929
/// </summary>
3030
[IntegrationTestTimeout]
31+
[SkipOnEnvironmentsWithKnownPerformanceIssues("we don't expect customers to execute it in this environment in a situation where it needs to behave within a reasonable timeframe.")]
3132
public class TentacleCommandLineTests : IntegrationTest
3233
{
3334
[Test]
@@ -272,7 +273,6 @@ public async Task CommandSpecificHelpAsJsonLooksSensibleToHumans(TentacleConfigu
272273

273274
[Test]
274275
[TentacleConfigurations(scriptServiceToTest: ScriptServiceVersionToTest.None)]
275-
[SkipOnEnvironmentsWithKnownPerformanceIssues]
276276
public async Task HelpForInstanceSpecificCommandsAlwaysWorks(TentacleConfigurationTestCase tc)
277277
{
278278
var (_, stdout, stderr) = await RunCommand(tc, null, "help", "--format=json");

source/Octopus.Tentacle.Tests.Integration/Util/SilentProcessRunnerFixture.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public void SetUpLocal()
3333
}
3434

3535
[Test]
36+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
3637
public void ExitCode_ShouldBeReturned()
3738
{
3839
using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)))
@@ -56,6 +57,7 @@ public void ExitCode_ShouldBeReturned()
5657
}
5758

5859
[Test]
60+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
5961
public void DebugLogging_ShouldContainDiagnosticsInfo_ForDefault()
6062
{
6163
using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)))
@@ -83,7 +85,7 @@ public void DebugLogging_ShouldContainDiagnosticsInfo_ForDefault()
8385

8486
[Test]
8587
[Retry(3)]
86-
[SkipOnEnvironmentsWithKnownPerformanceIssues]
88+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
8789
public void CancellationToken_ShouldForceKillTheProcess()
8890
{
8991
// Terminate the process after a very short time so the test doesn't run forever
@@ -116,6 +118,7 @@ public void CancellationToken_ShouldForceKillTheProcess()
116118
}
117119

118120
[Test]
121+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
119122
public void EchoHello_ShouldWriteToStdOut()
120123
{
121124
using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)))
@@ -138,6 +141,7 @@ public void EchoHello_ShouldWriteToStdOut()
138141
}
139142

140143
[Test]
144+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
141145
public void EchoError_ShouldWriteToStdErr()
142146
{
143147
using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)))
@@ -160,6 +164,7 @@ public void EchoError_ShouldWriteToStdErr()
160164
}
161165

162166
[Test]
167+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
163168
public void RunAsCurrentUser_ShouldWork()
164169
{
165170
using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)))
@@ -186,6 +191,7 @@ public void RunAsCurrentUser_ShouldWork()
186191
[Test]
187192
[WindowsTest]
188193
[TestCase("powershell.exe", "-command \"Write-Host $env:userdomain\\$env:username\"")]
194+
[SkipOnEnvironmentsWithKnownPerformanceIssues("it relies on timing, which may be inconsistent within the environment")]
189195
public void RunAsCurrentUser_PowerShell_ShouldWork(string command, string arguments)
190196
{
191197
using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)))

0 commit comments

Comments
 (0)