From 3f6b681d40a96631ebf22c5928468bb231fc2c37 Mon Sep 17 00:00:00 2001 From: Radovenchyk Date: Mon, 20 Apr 2026 08:48:40 +0300 Subject: [PATCH] fix(test): remove racy node startup from execution test --- node/execution_test.go | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/node/execution_test.go b/node/execution_test.go index 2765eb4d3c..91133a218d 100644 --- a/node/execution_test.go +++ b/node/execution_test.go @@ -4,7 +4,6 @@ package node import ( "context" - "errors" "testing" "time" @@ -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") @@ -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 {