Skip to content

Commit

Permalink
go/oasis-test-runner: Remove unnecessary epoch transitions after txs
Browse files Browse the repository at this point in the history
These epoch transitions can happen quickly and can cause the nodes to
expire and cause runtimes to be suspended, making the test deadlock.
  • Loading branch information
kostko committed Jun 28, 2022
1 parent bbcbb8a commit cdf8224
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions go/oasis-test-runner/scenario/e2e/runtime/multiple_runtimes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"time"

beacon "github.com/oasisprotocol/oasis-core/go/beacon/api"
"github.com/oasisprotocol/oasis-core/go/common"
"github.com/oasisprotocol/oasis-core/go/common/node"
"github.com/oasisprotocol/oasis-core/go/oasis-test-runner/env"
Expand Down Expand Up @@ -154,15 +153,13 @@ func (sc *multipleRuntimesImpl) Run(childEnv *env.Env) error {
}

// Wait for the nodes.
var epoch beacon.EpochTime
if epoch, err = sc.initialEpochTransitions(fixture); err != nil {
if _, err = sc.initialEpochTransitions(fixture); err != nil {
return err
}

ctx := context.Background()

// Submit transactions.
epoch++ // Want to advance the epoch.
numComputeRuntimeTxns, _ := sc.Flags.GetInt(cfgNumComputeRuntimeTxns)
for _, r := range sc.Net.Runtimes() {
rt := r.ToRuntimeDescriptor()
Expand All @@ -176,15 +173,6 @@ func (sc *multipleRuntimesImpl) Run(childEnv *env.Env) error {
if _, err := sc.submitKeyValueRuntimeInsertTx(ctx, rt.ID, "hello", fmt.Sprintf("world at iteration %d from %s", i, rt.ID), uint64(i)); err != nil {
return err
}

sc.Logger.Info("triggering epoch transition",
"epoch", epoch,
)
if err := sc.Net.Controller().SetEpoch(context.Background(), epoch); err != nil {
return fmt.Errorf("failed to set epoch: %w", err)
}
sc.Logger.Info("epoch transition done")
epoch++
}
}
}
Expand Down

0 comments on commit cdf8224

Please sign in to comment.