Skip to content

Commit

Permalink
Merge pull request #964 from iotaledger/fix/snapshot-dockertest
Browse files Browse the repository at this point in the history
Fix snapshot docker tests
  • Loading branch information
jkrvivian authored May 11, 2024
2 parents b390435 + 3f049a4 commit 33d12ea
Show file tree
Hide file tree
Showing 17 changed files with 403 additions and 229 deletions.
16 changes: 13 additions & 3 deletions pkg/testsuite/mock/blockissuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,21 @@ func (i *BlockIssuer) Address() iotago.Address {
func (i *BlockIssuer) CreateValidationBlock(ctx context.Context, alias string, node *Node, opts ...options.Option[ValidationBlockParams]) (*blocks.Block, error) {
blockParams := options.Apply(NewValidationBlockParams(), opts)

blockIssuanceInfo, err := i.Client.BlockIssuance(ctx)
require.NoError(i.Testing, err)

if blockParams.BlockHeader.IssuingTime == nil {
issuingTime := time.Now().UTC()
if issuingTime.Before(blockIssuanceInfo.LatestParentBlockIssuingTime) {
issuingTime = blockIssuanceInfo.LatestParentBlockIssuingTime.Add(time.Nanosecond)
}

blockParams.BlockHeader.IssuingTime = &issuingTime
}

apiForBlock := i.retrieveAPI(blockParams.BlockHeader)
protoParams := apiForBlock.ProtocolParameters()
blockIssuanceInfo, err := i.Client.BlockIssuance(ctx)
require.NoError(i.Testing, err)

if blockParams.BlockHeader.SlotCommitment == nil {
commitment := blockIssuanceInfo.LatestCommitment
blockSlot := apiForBlock.TimeProvider().SlotFromTime(*blockParams.BlockHeader.IssuingTime)
Expand Down Expand Up @@ -133,7 +139,7 @@ func (i *BlockIssuer) CreateValidationBlock(ctx context.Context, alias string, n
}

if blockParams.BlockHeader.References == nil {
blockParams.BlockHeader.References = referencesFromBlockIssuanceResponse(i.latestBlockIssuanceResponse(ctx))
blockParams.BlockHeader.References = referencesFromBlockIssuanceResponse(blockIssuanceInfo)
}

err = i.setDefaultBlockParams(ctx, blockParams.BlockHeader)
Expand Down Expand Up @@ -244,6 +250,10 @@ func (i *BlockIssuer) CreateBasicBlock(ctx context.Context, alias string, opts .
// set the issuing time last to ensure the timestamp is greater than that of the parents selected.
if blockParams.BlockHeader.IssuingTime == nil {
issuingTime := time.Now().UTC()
if issuingTime.Before(blockIssuanceInfo.LatestParentBlockIssuingTime) {
issuingTime = blockIssuanceInfo.LatestParentBlockIssuingTime.Add(time.Nanosecond)
}

blockParams.BlockHeader.IssuingTime = &issuingTime
}
blockBuilder.IssuingTime(*blockParams.BlockHeader.IssuingTime)
Expand Down
8 changes: 4 additions & 4 deletions tools/docker-network/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ services:
prometheus:
image: prom/prometheus:latest
stop_grace_period: 1m
restart: no
restart: unless-stopped
depends_on:
node-1-validator:
condition: service_started
Expand All @@ -219,7 +219,7 @@ services:

grafana:
image: grafana/grafana:9.5.6
restart: no
restart: unless-stopped
networks:
- iota-core
ports:
Expand Down Expand Up @@ -259,7 +259,7 @@ services:
inx-mqtt:
image: iotaledger/inx-mqtt:2.0-alpha
stop_grace_period: 1m
restart: no
restart: unless-stopped
depends_on:
node-1-validator:
condition: service_healthy
Expand Down Expand Up @@ -370,7 +370,7 @@ services:
inx-validator-4:
image: iotaledger/inx-validator:1.0-alpha
stop_grace_period: 1m
restart: unless-stopped
restart: no
depends_on:
node-4-validator:
condition: service_started
Expand Down
2 changes: 1 addition & 1 deletion tools/docker-network/tests/accounttransition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func Test_AccountTransitions(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

err := d.Run()
require.NoError(t, err)
Expand Down
226 changes: 114 additions & 112 deletions tools/docker-network/tests/api_core_test.go

Large diffs are not rendered by default.

41 changes: 17 additions & 24 deletions tools/docker-network/tests/api_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ func Test_ManagementAPI_Peers(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

runErr := d.Run()
require.NoError(t, runErr)

d.WaitUntilNetworkReady()

// wait longer for autopeering
d.AwaitCommitment(d.DefaultWallet().CurrentSlot())

// get the management client
managementClient, err := d.Client("V1").Management(getContextWithTimeout(5 * time.Second))
require.NoError(t, err)
Expand Down Expand Up @@ -132,7 +135,7 @@ func Test_ManagementAPI_Peers_BadRequests(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

runErr := d.Run()
require.NoError(t, runErr)
Expand Down Expand Up @@ -185,8 +188,8 @@ func Test_ManagementAPI_Peers_BadRequests(t *testing.T) {
func Test_ManagementAPI_Pruning(t *testing.T) {
d := dockertestframework.NewDockerTestFramework(t,
dockertestframework.WithProtocolParametersOptions(
iotago.WithTimeProviderOptions(0, time.Now().Unix(), 4, 4),
iotago.WithLivenessOptions(3, 4, 2, 4, 5),
iotago.WithTimeProviderOptions(0, time.Now().Unix(), 10, 3),
iotago.WithLivenessOptions(10, 10, 2, 4, 5),
iotago.WithCongestionControlOptions(1, 1, 1, 400_000, 250_000, 50_000_000, 1000, 100),
iotago.WithRewardsOptions(8, 10, 2, 384),
iotago.WithTargetCommitteeSize(4),
Expand All @@ -198,7 +201,7 @@ func Test_ManagementAPI_Pruning(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

runErr := d.Run()
require.NoError(t, runErr)
Expand All @@ -221,9 +224,9 @@ func Test_ManagementAPI_Pruning(t *testing.T) {
name: "Test_PruneDatabase_ByEpoch",
testFunc: func(t *testing.T) {
// we need to wait until epoch 3 to be able to prune epoch 1
d.AwaitNextEpoch()
d.AwaitNextEpoch()
d.AwaitNextEpoch()
d.AwaitEpochFinalized()
d.AwaitEpochFinalized()
d.AwaitEpochFinalized()

// prune database by epoch
pruneDatabaseResponse, err := managementClient.PruneDatabaseByEpoch(getContextWithTimeout(5*time.Second), 1)
Expand All @@ -235,7 +238,7 @@ func Test_ManagementAPI_Pruning(t *testing.T) {
name: "Test_PruneDatabase_ByDepth",
testFunc: func(t *testing.T) {
// wait for the next epoch to start
d.AwaitNextEpoch()
d.AwaitEpochFinalized()

// prune database by depth
pruneDatabaseResponse, err := managementClient.PruneDatabaseByDepth(getContextWithTimeout(5*time.Second), 1)
Expand All @@ -247,7 +250,7 @@ func Test_ManagementAPI_Pruning(t *testing.T) {
name: "Test_PruneDatabase_BySize",
testFunc: func(t *testing.T) {
// wait for the next epoch to start
d.AwaitNextEpoch()
d.AwaitEpochFinalized()

// prune database by size
pruneDatabaseResponse, err := managementClient.PruneDatabaseBySize(getContextWithTimeout(5*time.Second), "5G")
Expand All @@ -266,8 +269,8 @@ func Test_ManagementAPI_Pruning(t *testing.T) {
func Test_ManagementAPI_Snapshots(t *testing.T) {
d := dockertestframework.NewDockerTestFramework(t,
dockertestframework.WithProtocolParametersOptions(
iotago.WithTimeProviderOptions(0, time.Now().Unix(), 3, 4),
iotago.WithLivenessOptions(3, 4, 2, 4, 8),
iotago.WithTimeProviderOptions(0, time.Now().Unix(), 10, 3),
iotago.WithLivenessOptions(10, 10, 2, 4, 5),
iotago.WithCongestionControlOptions(1, 1, 1, 400_000, 250_000, 50_000_000, 1000, 100),
iotago.WithRewardsOptions(8, 10, 2, 384),
iotago.WithTargetCommitteeSize(4),
Expand All @@ -278,7 +281,7 @@ func Test_ManagementAPI_Snapshots(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

runErr := d.Run()
require.NoError(t, runErr)
Expand All @@ -291,16 +294,6 @@ func Test_ManagementAPI_Snapshots(t *testing.T) {
managementClient, err := nodeClientV1.Management(getContextWithTimeout(5 * time.Second))
require.NoError(t, err)

awaitNextCommittedEpoch := func() {
info, err := nodeClientV1.Info(getContextWithTimeout(5 * time.Second))
require.NoError(t, err)

currentEpoch := nodeClientV1.CommittedAPI().TimeProvider().EpochFromSlot(info.Status.LatestCommitmentID.Slot())

// await the start slot of the next epoch
d.AwaitCommitment(nodeClientV1.CommittedAPI().TimeProvider().EpochStart(currentEpoch + 1))
}

type test struct {
name string
testFunc func(t *testing.T)
Expand All @@ -311,7 +304,7 @@ func Test_ManagementAPI_Snapshots(t *testing.T) {
name: "Test_CreateSnapshot",
testFunc: func(t *testing.T) {
// wait for the next epoch to start
awaitNextCommittedEpoch()
d.AwaitEpochFinalized()

// create snapshot
snapshotResponse, err := managementClient.CreateSnapshot(getContextWithTimeout(5 * time.Second))
Expand Down
10 changes: 5 additions & 5 deletions tools/docker-network/tests/committeerotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test_SmallerCommittee(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

err := d.Run()
require.NoError(t, err)
Expand Down Expand Up @@ -81,7 +81,7 @@ func Test_ReuseDueToNoFinalization(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

err := d.Run()
require.NoError(t, err)
Expand Down Expand Up @@ -150,7 +150,7 @@ func Test_NoCandidacyPayload(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl", false)
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt", false)
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw", false)
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

err := d.Run()
require.NoError(t, err)
Expand Down Expand Up @@ -200,7 +200,7 @@ func Test_Staking(t *testing.T) {
d.AddValidatorNode("V2", "docker-network-inx-validator-2-1", "http://localhost:8060", "rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl")
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

err := d.Run()
require.NoError(t, err)
Expand Down Expand Up @@ -247,7 +247,7 @@ func Test_Delegation(t *testing.T) {
d.AddValidatorNode("V3", "docker-network-inx-validator-3-1", "http://localhost:8070", "rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt")
// V4 pubKey in hex: 0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe
d.AddValidatorNode("V4", "docker-network-inx-validator-4-1", "http://localhost:8040", "rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8090")
d.AddNode("node5", "docker-network-node-5-1", "http://localhost:8080")

err := d.Run()
require.NoError(t, err)
Expand Down
21 changes: 10 additions & 11 deletions tools/docker-network/tests/dockertestframework/asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func (d *DockerTestFramework) AssertCommittee(expectedEpoch iotago.EpochIndex, e
status := d.NodeStatus("V1")
testAPI := d.defaultWallet.Client.CommittedAPI()
expectedSlotStart := testAPI.TimeProvider().EpochStart(expectedEpoch)
require.Greater(d.Testing, expectedSlotStart, status.LatestAcceptedBlockSlot)

if status.LatestAcceptedBlockSlot < expectedSlotStart {
slotToWait := expectedSlotStart - status.LatestAcceptedBlockSlot
Expand All @@ -87,22 +86,22 @@ func (d *DockerTestFramework) AssertCommittee(expectedEpoch iotago.EpochIndex, e

d.Eventually(func() error {
for _, node := range d.Nodes() {
resp, err := d.Client(node.Name).Committee(context.TODO())
resp, err := d.Client(node.Name).Committee(context.TODO(), expectedEpoch)
if err != nil {
return err
}

if resp.Epoch == expectedEpoch {
members := make([]string, len(resp.Committee))
for i, member := range resp.Committee {
members[i] = member.AddressBech32
}
if resp.Epoch != expectedEpoch {
return ierrors.Errorf("expected epoch %d, but got %d", expectedEpoch, resp.Epoch)
}

sort.Strings(members)
if match := lo.Equal(expectedCommitteeMember, members); match {
return nil
}
members := make([]string, len(resp.Committee))
for i, member := range resp.Committee {
members[i] = member.AddressBech32
}

sort.Strings(members)
if !lo.Equal(expectedCommitteeMember, members) {
return ierrors.Errorf("committee members does not match as expected, expected: %v, actual: %v", expectedCommitteeMember, members)
}
}
Expand Down
21 changes: 16 additions & 5 deletions tools/docker-network/tests/dockertestframework/awaits.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ func (d *DockerTestFramework) AwaitTransactionFailure(ctx context.Context, txID

if expectedReason == resp.TransactionFailureReason {
return nil
} else {
return ierrors.Errorf("expected transaction %s to have failure reason '%s', got '%s' instead, failure details: %s", txID, expectedReason, resp.TransactionFailureReason, resp.TransactionFailureDetails)
}

return ierrors.Errorf("expected transaction %s to have failure reason '%s', got '%s' instead, failure details: %s", txID, expectedReason, resp.TransactionFailureReason, resp.TransactionFailureDetails)
})
}

Expand All @@ -92,17 +92,28 @@ func (d *DockerTestFramework) AwaitCommitment(targetSlot iotago.SlotIndex) {
}

func (d *DockerTestFramework) AwaitFinalization(targetSlot iotago.SlotIndex) {
d.Eventually(func() error {
currentFinalizedSlot := d.NodeStatus("V1").LatestFinalizedSlot

// we wait at max "targetSlot - currentFinalizedSlot" times * slot duration
deadline := time.Duration(d.defaultWallet.Client.CommittedAPI().ProtocolParameters().SlotDurationInSeconds()) * time.Second
if currentFinalizedSlot < targetSlot {
deadline *= time.Duration(targetSlot - currentFinalizedSlot)
}

// give some extra time for peering etc
deadline += 30 * time.Second

d.EventuallyWithDurations(func() error {
currentFinalisedSlot := d.NodeStatus("V1").LatestFinalizedSlot
if targetSlot > currentFinalisedSlot {
return ierrors.Errorf("finalized slot %d is not reached yet", targetSlot)
}

return nil
})
}, deadline, 1*time.Second)
}

func (d *DockerTestFramework) AwaitNextEpoch() {
func (d *DockerTestFramework) AwaitEpochFinalized() {
//nolint:lostcancel
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)

Expand Down
14 changes: 9 additions & 5 deletions tools/docker-network/tests/dockertestframework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,15 @@ func (d *DockerTestFramework) DockerComposeUp(detach ...bool) error {
}

func (d *DockerTestFramework) Run() error {
// first we remove old containers, volumes and orphans
_ = exec.Command("docker", "compose", "down", "-v", "--remove-orphans").Run()

ch := make(chan error)
stopCh := make(chan struct{})
defer close(ch)
defer close(stopCh)

ts := time.Now()
go func() {
err := d.DockerComposeUp()

Expand Down Expand Up @@ -165,7 +169,7 @@ loop:
}
case <-ticker.C:
fmt.Println("Waiting for nodes to become available...")
if d.waitForNodesAndGetClients() == nil {
if d.waitForNodesOnlineAndInitClients(ts) == nil {
break loop
}
}
Expand All @@ -183,7 +187,8 @@ func (d *DockerTestFramework) Stop() {
fmt.Println("Stop the network...")
defer fmt.Println("Stop the network.....done")

_ = exec.Command("docker", "compose", "down").Run()
// remove volumes and orphans
_ = exec.Command("docker", "compose", "down", "-v", "--remove-orphans").Run()
_ = exec.Command("rm", d.snapshotPath).Run() //nolint:gosec
}

Expand Down Expand Up @@ -242,12 +247,10 @@ func (d *DockerTestFramework) DumpContainerLog(name string, optLogNameExtension

func (d *DockerTestFramework) GetContainersConfigs() {
// get container configs
nodes := d.Nodes()

d.nodesLock.Lock()
defer d.nodesLock.Unlock()

for _, node := range nodes {
for _, node := range d.nodesWithoutLocking() {
cmd := fmt.Sprintf("docker inspect --format='{{.Config.Cmd}}' %s", node.ContainerName)
containerConfigsBytes, err := exec.Command("bash", "-c", cmd).Output()
require.NoError(d.Testing, err)
Expand All @@ -266,6 +269,7 @@ func (d *DockerTestFramework) GetContainersConfigs() {

node.ContainerConfigs = configs
node.PrivateKey = envs

d.nodes[node.Name] = node
}
}
Expand Down
Loading

0 comments on commit 33d12ea

Please sign in to comment.