Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions changelog/2026-12-05-draft-doctor-test-timeout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The test that runs `module:doctor --draft` on a draft in the repository now allows for the draft's own host tests, which the doctor gives up to 120 seconds; before, a draft whose `test_*.py` took over about 25 seconds failed the module-contract check with empty output.
6 changes: 4 additions & 2 deletions scripts/module-doctor.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { fileURLToPath } from 'node:url'
const root = fileURLToPath(new URL('../', import.meta.url))
const moduleCheckTimeout = 30_000
const catalogCheckTimeout = 120_000
// A draft's doctor runs its own test_*.py, which scripts/module-tests.mjs gives 120 s (runModuleTests' default): give the run that much more.
const hostTestTimeout = 120_000
const doctor = (...args) => spawnSync(process.execPath, ['scripts/module-doctor.mjs', ...args], {
cwd: root, encoding: 'utf8', timeout: args.includes('--all') ? catalogCheckTimeout : moduleCheckTimeout,
cwd: root, encoding: 'utf8', timeout: args.includes('--all') ? catalogCheckTimeout : args.includes('--draft') ? moduleCheckTimeout + hostTestTimeout : moduleCheckTimeout,
})

// Owner requirement, 6 October 2026: every module always integrates with the existing workflows. This is that requirement, enforced.
Expand Down Expand Up @@ -43,7 +45,7 @@ describe('module doctor', () => {
expect(result.stdout).not.toContain('once it is listed')
expect(existsSync(join(root, 'sdk/octatrack/modules', draft))).toBe(false)
expect(doctor('--draft', 'no-such-draft').status).toBe(2)
}, moduleCheckTimeout + 5000)
}, moduleCheckTimeout + hostTestTimeout + 5000)
// What npm run module:new writes is where every new author starts: it must pass the draft's experimental lines as it is, and
// build where the toolchain is (the same tools module-dev.test.mjs looks for). Named so npm run check runs it alone, with the test above.
it.skipIf(process.env.MODWERK_DEFER_DRAFT_DOCTOR === '1')('checks a draft where every gate looks: a fresh module:new draft of each kind', () => {
Expand Down