@@ -3,7 +3,6 @@ package shell
@@ -32,34 +31,6 @@ func TestShellPerformanceComparison(t *testing.T) {
32 t.Logf("Quick command took: %v", duration)
31 t.Logf("Quick command took: %v", duration)
35−func TestShellCPUUsageComparison(t *testing.T) {
36− tmpDir, err := os.MkdirTemp("", "shell-test")
37− require.NoError(t, err)
38− defer os.RemoveAll(tmpDir)
40− shell := GetPersistentShell(tmpDir)
43− // Measure CPU and memory usage during a longer command
44− var m1, m2 runtime.MemStats
46− runtime.ReadMemStats(&m1)
49− _, stderr, exitCode, _, err := shell.Exec(context.Background(), "sleep 0.1", 1000)
50− duration := time.Since(start)
52− runtime.ReadMemStats(&m2)
54− require.NoError(t, err)
55− assert.Equal(t, 0, exitCode)
56− assert.Empty(t, stderr)
58− memGrowth := m2.Alloc - m1.Alloc
59− t.Logf("Sleep 0.1s command took: %v", duration)
60− t.Logf("Memory growth during polling: %d bytes", memGrowth)
61− t.Logf("GC cycles during test: %d", m2.NumGC-m1.NumGC)
64// Benchmark CPU usage during polling
35// Benchmark CPU usage during polling
65func BenchmarkShellPolling(b *testing.B) {
36func BenchmarkShellPolling(b *testing.B) {