Repository navigation
test: plugin の片づけの試験で大文字小文字だけが違う名前を作らない(macOS で EEXIST) - #4397
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3991
何を直したか
packages/core/src/plugin-extract.test.tsの「片づけ > 今のストアに無い版と .tmp-* を消し、規則に合わないものは残す」は、plugins/の中にdemo@${SHA_A}(demo@aaa…a、40桁)を作った直後にdemo@${'A'.repeat(40)}を作っていた。大文字小文字を区別しない fs(macOS の既定の APFS)では、この2つは同じ名前になる。そのため2つ目のmkdirがEEXISTで落ちていた。大文字の側を
demo@${'C'.repeat(40)}に変えた。ほかに作る名前(a…・b…系)とは、大文字小文字を畳んでもぶつからない。直したのは試験だけで、製品のコードは変えていない。保証は弱くなっていない
この歯が測っているのは「
DIR_NAME_RULE(小文字の16進40桁)に合わない、大文字の16進の名前を片づけが消さない」ことである。Cも大文字の16進なので、測っているものは同じである。期待値(readdirの結果に残ること)も、同じ名前で引き続き見ている。macOS の実機(GitHub の
macos-latest)で確かめたことrepo には macOS の runner を回す workflow が無い。そこで、マージしない一時の枝に
runs-on: macos-latestの workflow を置いて回した(probe/macos-plugin-extract-3991/-old)。器はProductVersion: 26.6.2、File System Personality: APFS、node v22.23.3、TMPDIR=/var/folders/36/…/T/。plugin-extract.test.ts+plugins.test.ts9760a91aTests 1 failed | 85 passed (86)— 落ちたのは上の1件だけa64e14f4Tests 1 failed | 102 passed (103)— 落ちたのは上の1件だけTests 103 passed (103)落ちた1件のエラー文(逐語、main の木):
Issue の疑いについて、同じ run で分かったこと:
mkdir d && chmod 555 d && mv d eは終了コード 0 だった(rename 0o555 dir: 0)。展開の経路(0o700 の mkdir・O_NOFOLLOW|O_EXCL・0o444/0o555・同じ親での rename)を通る他の試験も、macOS で全部通った/var→/private/varの symlink も、plugin の2本には効いていない。 tmpdir は/var/folders/…のまま渡り、展開・再展開・片づけの試験はその root で通ったplugins.test.tsは、どちらの木でも macOS で全部通った確かめていないこと
plugins.test.tsの1件は、素の macOS では再現しなかった。 報告のときの木9760a91aでも、素の macOS で落ちたのは1件だけである。その器にしか無い要因が別に在ったはずだが、何だったかは確かめていない。候補は Issue に挙がっているサンドボックスや、pnpm verifyを比較用の木の build と同時に回した負荷などで、どれも推定である。その器の生の出力が無いので、この層ではこれ以上絞れないscratch-sweep.test.ts6件・rescue-ref.test.ts1件・mutate-scaffold-control.test.ts4件で、報告と同じ件数が素の macOS でも落ちた。これは plugin の展開器とは別の穴なので、この PR では触っていない(scratch-sweep・rescue-ref・mutate-scaffold-control の試験が macOS で落ちる(6件・1件・4件) #4399 に起こした)検証
pnpm --filter @alteroid/core exec vitest run src/plugin-extract.test.ts src/plugins.test.ts→Tests 103 passed (103)、pnpm --filter @alteroid/core typecheck→ exit 0Alteroid-Issue-Done: 3991