Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test(bin): import the lock holder's module by URL, not a relative path
The re-key wait test spawned its lock holder with an inline module that
imported './monitor/issue-store.mjs'. Resolved from bin/test that file
does not exist, and tracked-imports failed on every CI job: the guard
reported an untracked import, and V8 disagreed with the extractor. The
child now imports the module by a file URL built at run time, as
ledger-rotate-concurrent does.
  • Loading branch information
Portll committed Oct 11, 2026
commit c651bd3a8d7249e3484a8a83f9414ebc3736da69
4 changes: 2 additions & 2 deletions bin/test/issue-store-concurrency.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import assert from 'node:assert/strict';
import { mkdtempSync, rmSync, writeFileSync, readFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { spawn } from 'node:child_process';

import { emptyIssuesDoc, mintIssue, verifyChain, loadIssues, saveIssues, withIssuesLock } from '../../monitor/issue-store.mjs';
Expand Down Expand Up @@ -149,7 +149,7 @@ test('a re-key waits out a writer that holds the lock longer than a request hand
// writeSync, not stdout.write: a pipe write on macOS is async and would not flush before the wait blocks
const holder = spawn(process.execPath, ['--input-type=module', '-e', `
import { writeSync } from 'node:fs';
import { withIssuesLock } from './monitor/issue-store.mjs';
import { withIssuesLock } from ${JSON.stringify(pathToFileURL(join(CW, 'monitor', 'issue-store.mjs')).href)};
withIssuesLock(() => {
writeSync(1, 'held\\n');
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 2000);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitwork",
"version": "0.5.3",
"version": "0.5.4",
"description": "Repository security scanner, local CI runner and scheduled monitor, with remediation and compliance-evidence tooling. Manifest-driven; runs against any git repository.",
"type": "module",
"bin": {
Expand Down
Loading