Optimize test suite performance (15-18x speedup)

- Add t.Parallel() to CLI and export/import tests for concurrent execution
- Remove unnecessary 200ms sleep in daemon_autoimport_test (Execute forces sync)
- Reduce filesystem settle wait from 100ms to 50ms on non-Windows
- Optimize debouncer test sleeps (9 reductions, 30-50% faster)

Results:
- cmd/bd: 5+ minutes → 18 seconds
- internal/importer: < 1 second
- Most packages: < 2 seconds

Closes bd-gpe7
This commit is contained in:
Steve Yegge
2025-11-05 10:26:58 -08:00
parent 32849c727a
commit 0fc4da7358
4 changed files with 31 additions and 16 deletions

View File

@@ -21,6 +21,7 @@ func setupCLITestDB(t *testing.T) string {
}
func TestCLI_Ready(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
runBD(t, tmpDir, "create", "Ready issue", "-p", "1")
out := runBD(t, tmpDir, "ready")
@@ -30,6 +31,7 @@ func TestCLI_Ready(t *testing.T) {
}
func TestCLI_Create(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out := runBD(t, tmpDir, "create", "Test issue", "-p", "1", "--json")
@@ -43,6 +45,7 @@ func TestCLI_Create(t *testing.T) {
}
func TestCLI_List(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
runBD(t, tmpDir, "create", "First", "-p", "1")
runBD(t, tmpDir, "create", "Second", "-p", "2")
@@ -58,6 +61,7 @@ func TestCLI_List(t *testing.T) {
}
func TestCLI_Update(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out := runBD(t, tmpDir, "create", "Issue to update", "-p", "1", "--json")
@@ -76,6 +80,7 @@ func TestCLI_Update(t *testing.T) {
}
func TestCLI_Close(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out := runBD(t, tmpDir, "create", "Issue to close", "-p", "1", "--json")
@@ -94,6 +99,7 @@ func TestCLI_Close(t *testing.T) {
}
func TestCLI_DepAdd(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out1 := runBD(t, tmpDir, "create", "First", "-p", "1", "--json")
@@ -113,6 +119,7 @@ func TestCLI_DepAdd(t *testing.T) {
}
func TestCLI_DepRemove(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out1 := runBD(t, tmpDir, "create", "First", "-p", "1", "--json")
@@ -133,6 +140,7 @@ func TestCLI_DepRemove(t *testing.T) {
}
func TestCLI_DepTree(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out1 := runBD(t, tmpDir, "create", "Parent", "-p", "1", "--json")
@@ -153,6 +161,7 @@ func TestCLI_DepTree(t *testing.T) {
}
func TestCLI_Blocked(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out1 := runBD(t, tmpDir, "create", "Blocker", "-p", "1", "--json")
@@ -173,6 +182,7 @@ func TestCLI_Blocked(t *testing.T) {
}
func TestCLI_Stats(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
runBD(t, tmpDir, "create", "Issue 1", "-p", "1")
runBD(t, tmpDir, "create", "Issue 2", "-p", "1")
@@ -184,6 +194,7 @@ func TestCLI_Stats(t *testing.T) {
}
func TestCLI_Show(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
out := runBD(t, tmpDir, "create", "Show test", "-p", "1", "--json")
@@ -198,6 +209,7 @@ func TestCLI_Show(t *testing.T) {
}
func TestCLI_Export(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
runBD(t, tmpDir, "create", "Export test", "-p", "1")
@@ -210,6 +222,7 @@ func TestCLI_Export(t *testing.T) {
}
func TestCLI_Import(t *testing.T) {
t.Parallel()
tmpDir := setupCLITestDB(t)
runBD(t, tmpDir, "create", "Import test", "-p", "1")