Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
jberci committed Sep 4, 2020
1 parent 75121b7 commit 8478b21
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions go/oasis-test-runner/scenario/e2e/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
runtimeClient "github.com/oasisprotocol/oasis-core/go/runtime/client/api"
runtimeTransaction "github.com/oasisprotocol/oasis-core/go/runtime/transaction"
"github.com/oasisprotocol/oasis-core/go/storage/database"
workerStorage "github.com/oasisprotocol/oasis-core/go/worker/storage/api"
)

const (
Expand Down Expand Up @@ -447,6 +448,25 @@ func (sc *runtimeImpl) initialEpochTransitions() error {
if err := n.WaitReady(ctx); err != nil {
return fmt.Errorf("failed to wait for a storage worker: %w", err)
}
err := func() error {
ctrl, err := oasis.NewController(n.SocketPath())
if err != nil {
return fmt.Errorf("failed to connect with a storage node: %w", err)
}
defer ctrl.Close()
for _, rt := range sc.Net.Runtimes() {
req := &workerStorage.WaitCheckpointSyncedRequest{RuntimeID: rt.ID()}
err = ctrl.WorkerStorage.WaitCheckpointSynced(ctx, req)
if err != nil {
// Not fatal, because not all workers might have all runtimes configured.
sc.Logger.Debug("error waiting for storage worker to sync checkpoints", "runtime_id", rt.ID(), "err", err)
}
}
return nil
}()
if err != nil {
return err
}
}
sc.Logger.Info("waiting for compute workers to initialize",
"num_compute_workers", len(sc.Net.ComputeWorkers()),
Expand Down
1 change: 1 addition & 0 deletions go/oasis-test-runner/scenario/e2e/runtime/storage_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (sc *storageSyncImpl) Run(childEnv *env.Env) error {
if err != nil {
return fmt.Errorf("failed to connect with the late storage node: %w", err)
}
defer lateCtrl.Close()
err = lateCtrl.WorkerStorage.WaitCheckpointSynced(ctx, &workerStorage.WaitCheckpointSyncedRequest{RuntimeID: runtimeID})
if err != nil {
return fmt.Errorf("error waiting for late worker to sync checkpoints: %w", err)
Expand Down

0 comments on commit 8478b21

Please sign in to comment.