From eb5a3a2d3ec9f246f7f7892ebf396eff0d583f8a Mon Sep 17 00:00:00 2001 From: Milos Zivkovic Date: Thu, 25 Apr 2024 14:56:27 +0200 Subject: [PATCH] Revert dropped test context --- gno.land/cmd/gnoland/start_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gno.land/cmd/gnoland/start_test.go b/gno.land/cmd/gnoland/start_test.go index f34d4e5d66e..cdec6de0f99 100644 --- a/gno.land/cmd/gnoland/start_test.go +++ b/gno.land/cmd/gnoland/start_test.go @@ -5,6 +5,7 @@ import ( "context" "path/filepath" "testing" + "time" "github.com/gnolang/gno/tm2/pkg/commands" "github.com/stretchr/testify/assert" @@ -42,8 +43,12 @@ func TestStartInitialize(t *testing.T) { io.SetOut(commands.WriteNopCloser(mockOut)) io.SetErr(commands.WriteNopCloser(mockErr)) + // Create and run the command + ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) + defer cancelFn() + cmd := newRootCmd(io) - require.NoError(t, cmd.ParseAndRun(context.Background(), args)) + require.NoError(t, cmd.ParseAndRun(ctx, args)) // Make sure the directory is created assert.DirExists(t, nodeDir)