diff --git a/desktop/internal/workbench/app_test.go b/desktop/internal/workbench/app_test.go index bf5c96d803..898acefd82 100644 --- a/desktop/internal/workbench/app_test.go +++ b/desktop/internal/workbench/app_test.go @@ -127,6 +127,16 @@ func newHarnessWithDriver(t testing.TB, options Options, open func(app.Config) ( // the serve loops; cancel them before waiting for every task. h.app.stopAllPluginServers() if p := h.app.project; p != nil { + // A running test, debug session or run makes closeProject ask for the + // exit confirmation, so finishCloseProject never stopped them. Release + // them the same way here: their cleanup tasks wait for each process to + // exit and leave the process ledger in the preference directory, and + // h.app.wait() below then waits for those tasks before TempDir removal. + h.app.stopTestsForProject(p) + h.app.stopDebugForProject(p) + h.app.stopRunsForProject(p) + h.app.stopBuild(p) + h.app.stopVcs(p) p.cancel() h.app.closeTree(p) h.app.releaseProjectSearch(p) diff --git a/desktop/internal/workbench/title_run_test.go b/desktop/internal/workbench/title_run_test.go index 1bd3b3fa9d..4e8fdb90d1 100644 --- a/desktop/internal/workbench/title_run_test.go +++ b/desktop/internal/workbench/title_run_test.go @@ -153,7 +153,10 @@ func TestProviderDebugStartsTheNamedAdapter(t *testing.T) { p.debug.adapters = []debugAdapter{decoy, named} h.app.startProviderDebug(p, named.PluginID, core.BuildDebugPreparation{Adapter: named.Declaration.ID, Program: "bin/app", WorkingDirectory: "."}, nil) session := p.debug.activeSession() - if session == nil || session.adapter.Declaration.ID != named.Declaration.ID { + if session == nil { + t.Fatal("the provider did not start a debug session") + } + if session.adapter.Declaration.ID != named.Declaration.ID { t.Fatalf("session = %+v, want adapter %q", session, named.Declaration.ID) } launch := p.debug.pendingRemote.launchTarget