Fixes crash log downloads
This commit is contained in:
parent
08ee09af1e
commit
3abb1770c2
|
@ -60,7 +60,7 @@ namespace KubernetesWorkflow
|
||||||
var client = new Kubernetes(config);
|
var client = new Kubernetes(config);
|
||||||
while (!token.IsCancellationRequested)
|
while (!token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
token.WaitHandle.WaitOne(TimeSpan.FromSeconds(10));
|
token.WaitHandle.WaitOne(TimeSpan.FromSeconds(1));
|
||||||
|
|
||||||
var pod = container.Pod;
|
var pod = container.Pod;
|
||||||
var recipe = container.Recipe;
|
var recipe = container.Recipe;
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
using DistTestCore;
|
using DistTestCore;
|
||||||
using KubernetesWorkflow;
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
namespace Tests.BasicTests
|
namespace Tests.BasicTests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class ContinuousSubstitute : AutoBootstrapDistTest, ILogHandler
|
public class ContinuousSubstitute : AutoBootstrapDistTest
|
||||||
{
|
{
|
||||||
[Test]
|
[Test]
|
||||||
[UseLongTimeouts]
|
[UseLongTimeouts]
|
||||||
|
@ -60,13 +59,14 @@ namespace Tests.BasicTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
[UseLongTimeouts]
|
||||||
public void HoldMyBeerTest()
|
public void HoldMyBeerTest()
|
||||||
{
|
{
|
||||||
var group = SetupCodexNodes(2, o => o
|
var group = SetupCodexNodes(5, o => o
|
||||||
.EnableMetrics()
|
.EnableMetrics()
|
||||||
//.EnableMarketplace(100000.TestTokens(), 0.Eth(), isValidator: true)
|
//.EnableMarketplace(100000.TestTokens(), 0.Eth(), isValidator: true)
|
||||||
.WithBlockTTL(TimeSpan.FromMinutes(2))
|
.WithBlockTTL(TimeSpan.FromMinutes(2))
|
||||||
.WithBlockMaintenanceInterval(TimeSpan.FromMinutes(10))
|
.WithBlockMaintenanceInterval(TimeSpan.FromMinutes(5))
|
||||||
.WithBlockMaintenanceNumber(10000)
|
.WithBlockMaintenanceNumber(10000)
|
||||||
.WithStorageQuota(500.MB()));
|
.WithStorageQuota(500.MB()));
|
||||||
|
|
||||||
|
@ -81,44 +81,31 @@ namespace Tests.BasicTests
|
||||||
// maxDuration: TimeSpan.FromMinutes(5));
|
// maxDuration: TimeSpan.FromMinutes(5));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
Thread.Sleep(2000);
|
//Thread.Sleep(2000);
|
||||||
|
|
||||||
Log("calling crash...");
|
//Log("calling crash...");
|
||||||
var http = new Http(Get().Log, Get().TimeSet, nodes.First().CodexAccess.Address, baseUrl: "/api/codex/v1", nodes.First().CodexAccess.Container.Name);
|
//var http = new Http(Get().Log, Get().TimeSet, nodes.First().CodexAccess.Address, baseUrl: "/api/codex/v1", nodes.First().CodexAccess.Container.Name);
|
||||||
var str = http.HttpGetString("debug/crash");
|
//var str = http.HttpGetString("debug/crash");
|
||||||
|
|
||||||
Log("crash called.");
|
//Log("crash called.");
|
||||||
|
|
||||||
|
//Thread.Sleep(TimeSpan.FromSeconds(60));
|
||||||
|
|
||||||
|
//Log("test done.");
|
||||||
|
|
||||||
|
var endTime = DateTime.UtcNow + TimeSpan.FromHours(2);
|
||||||
|
while (DateTime.UtcNow < endTime)
|
||||||
|
{
|
||||||
|
foreach (var node in nodes)
|
||||||
|
{
|
||||||
|
var file = GenerateTestFile(80.MB());
|
||||||
|
var cid = node.UploadFile(file);
|
||||||
|
|
||||||
|
var dl = node.DownloadContent(cid);
|
||||||
|
file.AssertIsEqual(dl);
|
||||||
|
}
|
||||||
|
|
||||||
Thread.Sleep(TimeSpan.FromSeconds(60));
|
Thread.Sleep(TimeSpan.FromSeconds(60));
|
||||||
|
|
||||||
Log("test done.");
|
|
||||||
|
|
||||||
//var endTime = DateTime.UtcNow + TimeSpan.FromHours(2);
|
|
||||||
//while (DateTime.UtcNow < endTime)
|
|
||||||
//{
|
|
||||||
// foreach (var node in nodes)
|
|
||||||
// {
|
|
||||||
// var file = GenerateTestFile(80.MB());
|
|
||||||
// var cid = node.UploadFile(file);
|
|
||||||
|
|
||||||
// var dl = node.DownloadContent(cid);
|
|
||||||
// file.AssertIsEqual(dl);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Thread.Sleep(TimeSpan.FromSeconds(30));
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Log(Stream log)
|
|
||||||
{
|
|
||||||
Log("Well damn, container crashed. Here's the log:");
|
|
||||||
using var reader = new StreamReader(log);
|
|
||||||
|
|
||||||
var line = reader.ReadLine();
|
|
||||||
while(line != null)
|
|
||||||
{
|
|
||||||
Log(line);
|
|
||||||
line = reader.ReadLine();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue