Debugs AutoBootstrapDistTest

This commit is contained in:
benbierens 2023-05-10 09:09:31 +02:00
parent 1d224cf2d3
commit 2a55328d11
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 9 additions and 17 deletions

View File

@ -1,9 +1,9 @@
namespace DistTestCore
using NUnit.Framework;
namespace DistTestCore
{
public class AutoBootstrapDistTest : DistTest
{
private IOnlineCodexNode? bootstrapNode;
public override IOnlineCodexNode SetupCodexBootstrapNode(Action<ICodexSetup> setup)
{
throw new Exception("AutoBootstrapDistTest creates and attaches a single boostrap node for you. " +
@ -14,25 +14,16 @@
{
var codexSetup = new CodexSetup(numberOfNodes);
setup(codexSetup);
codexSetup.WithBootstrapNode(EnsureBootstapNode());
codexSetup.WithBootstrapNode(BootstrapNode);
return BringOnline(codexSetup);
}
protected IOnlineCodexNode BootstrapNode
[SetUp]
public void SetUpBootstrapNode()
{
get
{
return EnsureBootstapNode();
}
BootstrapNode = BringOnline(new CodexSetup(1))[0];
}
private IOnlineCodexNode EnsureBootstapNode()
{
if (bootstrapNode == null)
{
bootstrapNode = base.SetupCodexBootstrapNode(s => { });
}
return bootstrapNode;
}
protected IOnlineCodexNode BootstrapNode { get; private set; } = null!;
}
}

View File

@ -5,6 +5,7 @@ using Utils;
namespace Tests.PeerDiscoveryTests
{
[TestFixture]
public class PeerDiscoveryTests : AutoBootstrapDistTest
{
[Test]