Skip to content

test(desktop): TestProviderDebugStartsTheNamedAdapter 偶发 TempDir 清理失败(偏好目录有残留写入) #1956

Closed

Description

@xiaoyumuxi

现象

desktop/internal/workbench 的 TestProviderDebugStartsTheNamedAdapter(title_run_test.go,#1837 引入)在整包运行时偶发失败:

--- FAIL: TestProviderDebugStartsTheNamedAdapter (0.09s)
    testing.go:1619: TempDir RemoveAll cleanup: unlinkat /var/folders/.../T/TestProviderDebugStartsTheNamedAdapter3653939602/001: directory not empty

初步判断

001 是 debugHarnessWith 创建的第一个 TempDir,即偏好目录(store.At(dir))。测试调用 startProviderDebug 启动了调试会话但没有停止,测试返回后仍有异步写入落进偏好目录,与 t.TempDir 的 RemoveAll 竞争。

期望

按 write-stable-tests 的资源清理规则,测试(或 debugHarness)在 cleanup 中停止会话并有界等待所有后台写入结束,再交给 TempDir 清理;同一 harness 的其他调试测试一并检查。

Activity

  1. added
    review: high
    on Nov 15, 2026
  2. xiaoyumuxi commented on Nov 17, 2026

    @xiaoyumuxi
    CollaboratorAuthor

    已修复并合入 main:#1982 让测试 harness 收尾时先停止调试、运行、测试会话并等待清理任务结束,再删除 TempDir;#2080 修复了 #1982 合入后暴露的 workbench 测试包 panic。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    review: high

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions