Skip to content

Commit c1fa309

Browse files
committed
Applies long timesets for cluster runs
1 parent 536d297 commit c1fa309

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

Framework/KubernetesWorkflow/Types/RunningContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public RunningContainer(string id, string name, ContainerRecipe recipe, Containe
2727
public Address GetAddress(string portTag)
2828
{
2929
var addresses = Addresses.Where(a => a.PortTag == portTag).ToArray();
30-
if (!addresses.Any()) throw new Exception("No addresses found for portTag: " + portTag);
30+
if (addresses.Length == 0) throw new Exception("No addresses found for portTag: " + portTag);
3131

3232
var select = SelectAddress(addresses);
3333
return select.Address;

Tests/CodexReleaseTests/DataTests/DecodeTest.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Security.Cryptography;
2-
using CodexReleaseTests.Utils;
3-
using Nethereum.JsonRpc.Client;
1+
using CodexReleaseTests.Utils;
42
using NUnit.Framework;
53
using Utils;
64

Tests/DistTestCore/DistTest.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,34 @@ private void WriteEndTestLog(TestLog log)
179179

180180
private IWebCallTimeSet GetWebCallTimeSet()
181181
{
182+
if (IsRunningInCluster())
183+
{
184+
Log(" > Detected we're running in the cluster. Using long webCall timeset.");
185+
return new LongWebCallTimeSet();
186+
}
187+
182188
if (ShouldUseLongTimeouts()) return new LongWebCallTimeSet();
183189
return new DefaultWebCallTimeSet();
184190
}
185191

186192
private IK8sTimeSet GetK8sTimeSet()
187193
{
194+
if (IsRunningInCluster())
195+
{
196+
Log(" > Detected we're running in the cluster. Using long kubernetes timeset.");
197+
return new LongK8sTimeSet();
198+
}
199+
188200
if (ShouldUseLongTimeouts()) return new LongK8sTimeSet();
189201
return new DefaultK8sTimeSet();
190202
}
191203

204+
private bool IsRunningInCluster()
205+
{
206+
var testType = Environment.GetEnvironmentVariable("TEST_TYPE");
207+
return testType == "release-tests";
208+
}
209+
192210
private bool ShouldWaitForCleanup()
193211
{
194212
return CurrentTestMethodHasAttribute<WaitForCleanupAttribute>();
@@ -256,7 +274,7 @@ private bool ShouldDownloadAllLogs(TestStatus testStatus)
256274

257275
private string GetCurrentTestName()
258276
{
259-
return $"[{TestContext.CurrentContext.Test.Name}]";
277+
return $"[{NameUtils.GetTestMethodName()}]";
260278
}
261279

262280
public DistTestResult GetTestResult()

0 commit comments

Comments
 (0)