Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions node/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package node

import (
"context"
"errors"
"testing"
"time"

Expand All @@ -22,16 +21,6 @@ func TestBasicExecutionFlow(t *testing.T) {
node, cleanup := createNodeWithCleanup(t, getTestConfig(t, 1))
defer cleanup()

ctx, cancel := context.WithCancel(t.Context())
defer cancel()
go func() {
_ = node.Run(ctx)
}()

// Wait for node initialization
err := waitForNodeInitialization(node)
require.NoError(err)

// Get the original executor to retrieve transactions
executor := getExecutorFromNode(t, node)
require.NotNil(executor, "Executor should not be nil")
Expand Down Expand Up @@ -64,27 +53,6 @@ func TestBasicExecutionFlow(t *testing.T) {
finalizeExecution(t, mockExec, t.Context())

require.NotEmpty(newStateRoot)
cancel()
time.Sleep(100 * time.Millisecond) // grace period for node shutdown and cleanup
}

func waitForNodeInitialization(node *FullNode) error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop()

for {
select {
case <-ticker.C:
if node.IsRunning() {
return nil
}
case <-ctx.Done():
return errors.New("timeout waiting for node initialization")
}
}
}

func getExecutorFromNode(t *testing.T, node *FullNode) coreexecutor.Executor {
Expand Down
Loading