Skip to content

experiment: plain fixture writes on Linux (do not merge) - #67

Closed
fi3ework wants to merge 5 commits into
mainfrom
experiment/plain-writes-linux
Closed

fi3ework wants to merge 5 commits into
mainfrom
experiment/plain-writes-linux

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Exists only to measure Linux E2E flakiness with non-atomic fixture writes; will be closed.

rstack-ecosystem-ci runs every suite on ubuntu-latest, so a green Linux
E2E run is the prerequisite for joining it (#40, part 2). Two things
stood in the way, both named in the comment this commit replaces.

The Extension Host needs an X server and the libraries Electron links
against, which ubuntu-latest (24.04) does not ship. Add ubuntu-latest to
the E2E matrix, install libasound2t64 / libgbm1 / libgtk-3-0t64 /
libnss3 / xvfb, and wrap the chain in `xvfb-run -a`.

The suites also rewrote fixture files with `fs.writeFileSync`, which
truncates and then writes. Linux inotify reports that as two events, so
a watcher reading on the first one sees an empty config or an empty
source file — a state no user produces. Route every fixture rewrite
through `e2e/shared/atomicWrite.ts`, which writes a sibling temp file
and renames it over the target: one event on every platform. On Windows
`rename` over a file another process holds open fails with EPERM/EBUSY,
so the helper retries and then falls back to a plain write, keeping the
previous behavior as the worst case.
The helper had a Windows branch: retry the rename on EPERM/EBUSY, sleep
with Atomics.wait between attempts, then fall back to the plain write it
exists to avoid. That is three behaviors for one operation and the
fallback is the worst of them — it silently restores the truncate/write
pair on the one platform where nobody would notice.

Reduce it to one path on every OS: write the sibling temp file, rename
it over the target, remove the temp file in `finally`. If rename fails,
it throws and the test fails with that error. The sync variant goes with
it, so every call site is now `await writeFileAtomic(...)`; ordering is
unchanged, the write still lands before the waiter it was paired with.
`restoreWorkspaceSettings` becomes async for the same reason and its one
caller awaits it in place.

Also correct the apt step comment: the ubuntu-latest image already
carries all five packages, so the step installs nothing today. It stays
because the image's package set is not a contract and the eco-ci runner
images this job mirrors need not carry them.
@fi3ework fi3ework closed this Sep 21, 2026
@fi3ework
fi3ework deleted the experiment/plain-writes-linux branch September 21, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant