diff --git a/CodexNetDeployer/CodexNodeStarter.cs b/CodexNetDeployer/CodexNodeStarter.cs index f6faafa..a370615 100644 --- a/CodexNetDeployer/CodexNodeStarter.cs +++ b/CodexNetDeployer/CodexNodeStarter.cs @@ -87,6 +87,10 @@ namespace CodexNetDeployer var marketplaceConfig = new MarketplaceInitialConfig(100000.Eth(), 0.TestTokens(), validatorsLeft > 0); marketplaceConfig.AccountIndexOverride = i; codexStart.MarketplaceConfig = marketplaceConfig; + if (config.BlockTTL != Configuration.SecondsIn1Day) + { + codexStart.BlockTTL = config.BlockTTL; + } return codexStart; } diff --git a/CodexNetDeployer/Configuration.cs b/CodexNetDeployer/Configuration.cs index 3d79b0e..648e5bb 100644 --- a/CodexNetDeployer/Configuration.cs +++ b/CodexNetDeployer/Configuration.cs @@ -7,6 +7,8 @@ namespace CodexNetDeployer { public class Configuration { + public const int SecondsIn1Day = 24 * 60 * 60; + [Uniform("codex-image", "ci", "CODEXIMAGE", true, "Docker image of Codex.")] public string CodexImage { get; set; } = CodexContainerRecipe.DockerImage; @@ -49,6 +51,9 @@ namespace CodexNetDeployer [Uniform("max-duration", "md", "MAXDURATION", true, "Maximum duration in seconds for contracts which will be accepted.")] public int MaxDuration { get; set; } + [Uniform("block-ttl", "bt", "BLOCKTTL", false, "Block timeout in seconds. Default is 24 hours.")] + public int BlockTTL { get; set; } = SecondsIn1Day; + public TestRunnerLocation RunnerLocation { get; set; } = TestRunnerLocation.InternalToCluster; public List Validate() diff --git a/ContinuousTests/NodeRunner.cs b/ContinuousTests/NodeRunner.cs index be6d416..ee4a554 100644 --- a/ContinuousTests/NodeRunner.cs +++ b/ContinuousTests/NodeRunner.cs @@ -71,7 +71,15 @@ namespace ContinuousTests var codexAccess = new CodexAccess(lifecycle, container); var marketAccess = new MarketplaceAccess(lifecycle, marketplaceNetwork, account, codexAccess); - operation(codexAccess, marketAccess); + try + { + operation(codexAccess, marketAccess); + } + catch + { + lifecycle.DownloadLog(container); + throw; + } } finally { diff --git a/ContinuousTests/SingleTestRun.cs b/ContinuousTests/SingleTestRun.cs index 585971a..8f29c34 100644 --- a/ContinuousTests/SingleTestRun.cs +++ b/ContinuousTests/SingleTestRun.cs @@ -167,7 +167,8 @@ namespace ContinuousTests private void OverviewLog(string msg) { Log(msg); - overviewLog.Log(testName + ": " + msg); + var containerNames = $"({string.Join(",", nodes.Select(n => n.Container.Name))})"; + overviewLog.Log( testName + ": " + msg); } private CodexNode[] CreateRandomNodes(int number) diff --git a/DistTestCore/Codex/CodexContainerRecipe.cs b/DistTestCore/Codex/CodexContainerRecipe.cs index b7c3b94..83e1948 100644 --- a/DistTestCore/Codex/CodexContainerRecipe.cs +++ b/DistTestCore/Codex/CodexContainerRecipe.cs @@ -40,6 +40,10 @@ namespace DistTestCore.Codex { AddEnvVar("STORAGE_QUOTA", config.StorageQuota.SizeInBytes.ToString()!); } + if (config.BlockTTL != null) + { + AddEnvVar("BLOCK_TTL", config.BlockTTL.ToString()!); + } if (config.MetricsEnabled) { AddEnvVar("METRICS_ADDR", "0.0.0.0"); diff --git a/DistTestCore/Codex/CodexNode.cs b/DistTestCore/Codex/CodexNode.cs index bb2220e..3e33225 100644 --- a/DistTestCore/Codex/CodexNode.cs +++ b/DistTestCore/Codex/CodexNode.cs @@ -1,4 +1,5 @@ -using Logging; +using KubernetesWorkflow; +using Logging; using Utils; namespace DistTestCore.Codex @@ -8,13 +9,15 @@ namespace DistTestCore.Codex private readonly BaseLog log; private readonly ITimeSet timeSet; - public CodexNode(BaseLog log, ITimeSet timeSet, Address address) + public CodexNode(BaseLog log, RunningContainer container, ITimeSet timeSet, Address address) { this.log = log; + Container = container; this.timeSet = timeSet; Address = address; } + public RunningContainer Container { get; } public Address Address { get; } public CodexDebugResponse GetDebugInfo() diff --git a/DistTestCore/Codex/CodexStartupConfig.cs b/DistTestCore/Codex/CodexStartupConfig.cs index b13512b..2a17334 100644 --- a/DistTestCore/Codex/CodexStartupConfig.cs +++ b/DistTestCore/Codex/CodexStartupConfig.cs @@ -17,5 +17,6 @@ namespace DistTestCore.Codex public bool MetricsEnabled { get; set; } public MarketplaceInitialConfig? MarketplaceConfig { get; set; } public string? BootstrapSpr { get; set; } + public int? BlockTTL { get; set; } } }