Applies long timesets for cluster runs

This commit is contained in:
ThatBen 2025-06-20 08:40:48 +02:00
parent 536d297365
commit c1fa309271
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
3 changed files with 21 additions and 5 deletions

View File

@ -27,7 +27,7 @@ namespace KubernetesWorkflow.Types
public Address GetAddress(string portTag)
{
var addresses = Addresses.Where(a => a.PortTag == portTag).ToArray();
if (!addresses.Any()) throw new Exception("No addresses found for portTag: " + portTag);
if (addresses.Length == 0) throw new Exception("No addresses found for portTag: " + portTag);
var select = SelectAddress(addresses);
return select.Address;

View File

@ -1,6 +1,4 @@
using System.Security.Cryptography;
using CodexReleaseTests.Utils;
using Nethereum.JsonRpc.Client;
using CodexReleaseTests.Utils;
using NUnit.Framework;
using Utils;

View File

@ -179,16 +179,34 @@ namespace DistTestCore
private IWebCallTimeSet GetWebCallTimeSet()
{
if (IsRunningInCluster())
{
Log(" > Detected we're running in the cluster. Using long webCall timeset.");
return new LongWebCallTimeSet();
}
if (ShouldUseLongTimeouts()) return new LongWebCallTimeSet();
return new DefaultWebCallTimeSet();
}
private IK8sTimeSet GetK8sTimeSet()
{
if (IsRunningInCluster())
{
Log(" > Detected we're running in the cluster. Using long kubernetes timeset.");
return new LongK8sTimeSet();
}
if (ShouldUseLongTimeouts()) return new LongK8sTimeSet();
return new DefaultK8sTimeSet();
}
private bool IsRunningInCluster()
{
var testType = Environment.GetEnvironmentVariable("TEST_TYPE");
return testType == "release-tests";
}
private bool ShouldWaitForCleanup()
{
return CurrentTestMethodHasAttribute<WaitForCleanupAttribute>();
@ -256,7 +274,7 @@ namespace DistTestCore
private string GetCurrentTestName()
{
return $"[{TestContext.CurrentContext.Test.Name}]";
return $"[{NameUtils.GetTestMethodName()}]";
}
public DistTestResult GetTestResult()