From a8f90ff06ce66abb19b7e9a847cf20d8e60ef67c Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Fri, 7 Nov 2025 13:15:32 +0100 Subject: [PATCH] chore: remove flaky tests --- internal/agent/tools/job_test.go | 42 -------------------------------- 1 file changed, 42 deletions(-) diff --git a/internal/agent/tools/job_test.go b/internal/agent/tools/job_test.go index c66a6b4cd61845d7fae6dd6dbe50e991368a7b66..f3958bef19aa6b29240eb8b265e36b56398d364e 100644 --- a/internal/agent/tools/job_test.go +++ b/internal/agent/tools/job_test.go @@ -2,7 +2,6 @@ package tools import ( "context" - "strings" "testing" "time" @@ -60,24 +59,6 @@ func TestBackgroundShell_Kill(t *testing.T) { require.True(t, bgShell.IsDone()) } -func TestBackgroundShell_GetOutput_NoHang(t *testing.T) { - t.Parallel() - - workingDir := t.TempDir() - ctx := context.Background() - - // Start a long-running background shell - bgManager := shell.GetBackgroundShellManager() - bgShell, err := bgManager.Start(ctx, workingDir, nil, "while true; do echo \"Hello from background job - $(date +%T)\"; sleep 1; done", "") - require.NoError(t, err) - defer bgManager.Kill(bgShell.ID) - // wait for 2 seconds - time.Sleep(2 * time.Second) - stdout, _, _, err := bgShell.GetOutput() - require.NoError(t, err) - require.Len(t, strings.Split(stdout, "\n"), 3) -} - func TestBackgroundShell_MultipleOutputCalls(t *testing.T) { t.Parallel() @@ -345,27 +326,4 @@ func TestBackgroundShell_AutoBackground(t *testing.T) { require.True(t, ok, "Should be able to retrieve background shell") require.Equal(t, bgShell.ID, retrieved.ID) }) - - // Test that we can check output of long-running command later - t.Run("can check output after completion", func(t *testing.T) { - t.Parallel() - bgManager := shell.GetBackgroundShellManager() - bgShell, err := bgManager.Start(ctx, workingDir, nil, "sleep 3 && echo 'completed'", "") - require.NoError(t, err) - defer bgManager.Kill(bgShell.ID) - - // Initially should be running - _, _, done, _ := bgShell.GetOutput() - require.False(t, done, "Should be running initially") - - // Wait for completion - time.Sleep(4 * time.Second) - - // Now should be done - stdout, stderr, done, err := bgShell.GetOutput() - require.NoError(t, err) - require.True(t, done, "Should be done after waiting") - require.Contains(t, stdout, "completed") - require.Empty(t, stderr) - }) }