Hooks up block maintenance interval config param.

This commit is contained in:
benbierens 2023-08-14 15:51:03 +02:00
parent 6e5e30afd4
commit c0b7d3a747
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
5 changed files with 14 additions and 0 deletions

View File

@ -51,6 +51,10 @@ namespace DistTestCore.Codex
{
AddEnvVar("CODEX_BLOCK_TTL", config.BlockTTL.ToString()!);
}
if (config.BlockMaintenanceInterval != null)
{
AddEnvVar("CODEX_BLOCK_MI", Convert.ToInt32(config.BlockMaintenanceInterval.Value.TotalSeconds).ToString());
}
if (config.MetricsMode != Metrics.MetricsMode.None)
{
AddEnvVar("CODEX_METRICS", "true");

View File

@ -19,5 +19,6 @@ namespace DistTestCore.Codex
public MarketplaceInitialConfig? MarketplaceConfig { get; set; }
public string? BootstrapSpr { get; set; }
public int? BlockTTL { get; set; }
public TimeSpan? BlockMaintenanceInterval { get; set; }
}
}

View File

@ -11,6 +11,7 @@ namespace DistTestCore
ICodexSetup WithBootstrapNode(IOnlineCodexNode node);
ICodexSetup WithStorageQuota(ByteSize storageQuota);
ICodexSetup WithBlockTTL(TimeSpan duration);
ICodexSetup WithBlockMaintenanceInterval(TimeSpan duration);
ICodexSetup EnableMetrics();
ICodexSetup EnableMarketplace(TestToken initialBalance);
ICodexSetup EnableMarketplace(TestToken initialBalance, Ether initialEther);
@ -57,6 +58,12 @@ namespace DistTestCore
return this;
}
public ICodexSetup WithBlockMaintenanceInterval(TimeSpan duration)
{
BlockMaintenanceInterval = duration;
return this;
}
public ICodexSetup EnableMetrics()
{
MetricsMode = Metrics.MetricsMode.Record;

View File

@ -15,6 +15,7 @@ namespace DistTestCore
: base(lifecycle)
{
}
public GrafanaStartInfo StartDashboard(RunningContainer prometheusContainer, CodexSetup codexSetup)
{
LogStart($"Starting dashboard server");

View File

@ -67,6 +67,7 @@ namespace Tests.BasicTests
.EnableMetrics()
.EnableMarketplace(100000.TestTokens(), 0.Eth(), isValidator: true)
.WithBlockTTL(TimeSpan.FromMinutes(2))
.WithBlockMaintenanceInterval(TimeSpan.FromMinutes(3))
.WithStorageQuota(3.GB()));
var nodes = group.Cast<OnlineCodexNode>().ToArray();