[Bug] Windows CI 上 TestPluginSaveWritesTheCurrentTextAtTheExpectedVersion 偶现文件被占用无法移除保存失败

オープン
#2,380 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
desktop

調査の方向性

Start at desktop/internal/workbench/pluginfilechanges_test.go:48-66 and reproduce with ./scripts/desktop/desktop-go.sh test ./... on a Windows runner (it passes on Linux/macOS, so the failure is Windows-only). Follow w.SaveDocument into the plugin host code that raises plugin.host.failed: The save failed: Unable to remove the file to be replaced. — that remove/replace step is where a lingering file handle or transient lock bites. Done means the test passes reliably on Windows, either by closing handles before the replace or retrying on transient lock errors.

索引モデルが issue の本文から書いたものです。

説明

review: high
Platform / 平台

Windows

Area / 模块

Editor / 编辑器

Lithe version / Lithe 版本

d5a091c83(基于 3d7b5acb5,PR #2342 与插件文件保存无关改动)

Priority / 优先级

P2 / 后续考虑:目前不着急,可安排到后续版本

OS and architecture / 操作系统与架构

Windows Server 2022 (windows-2022), x86_64 (GitHub Actions runner)

Environment / 环境信息
  • Go:desktop/go.mod 固定版本;Viva:github.com/Lithe-IDEA/viva bb85256c8ffa
  • Core:PINNED_CORE_REVISION=9ab2336e8ca651e40baa5e65848b717b26f69e43
  • 复现环境:GitHub Actions Desktop CI / Vet and test on Windows(Run 45318253535 Attempt 1,同节点 Linux 与 macOS 全量通过)
Steps to reproduce / 复现步骤
  1. 在 Windows runner 上运行全量 ./scripts/desktop/desktop-go.sh test ./...。
  2. desktop/internal/workbench/pluginfilechanges_test.go:48-66(TestPluginSaveWritesTheCurrentTextAtTheExpectedVersion)先用过期版本号调用 w.SaveDocument 验证版本冲突未写盘,再用最新版本号调用 w.SaveDocument 保存文档。
Expected behavior / 预期行为

携带最新版本号调用 w.SaveDocument 时稳定将 "ALPHA" 写入目标文件并清除脏标记。

Actual behavior / 实际行为

在 Windows runner 上偶发失败:w.SaveDocument 返回 plugin.host.failed: The save failed: Unable to remove the file to be replaced.,磁盘内容仍为 "alpha"。可能与 Windows 共享句柄未释放、搜索索引/杀毒短时占用或替换实现未处理瞬态文件锁有关。

Logs or diagnostic output / 日志或诊断输出
# GitHub Actions Run 45318253535 (Attempt 1, Vet and test on Windows)
--- FAIL: TestPluginSaveWritesTheCurrentTextAtTheExpectedVersion (0.17s)
    pluginfilechanges_test.go:64: save = {DocumentID: Version:0 Path:<nil> LanguageID:<nil> IsReadOnly:false IsDirty:false Encoding: LineEnding:}, plugin.host.failed: The save failed: Unable to remove the file to be replaced., disk "alpha"
FAIL
FAIL	github.com/1lck/Lithe-IDEA/desktop/internal/workbench	278.151s
Screenshots or recordings / 截图或录屏

不适用:纯 Windows 保存测试偶发失败,无桌面界面变化。

Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
主要言語
TypeScript
スター
1.8k
フォーク
151
平均マージ
4時間 4分
マージ済み PR(30日)
558

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

1lck/Lithe-IDEA のほかの issue

1lck/Lithe-IDEA の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。