diff --git a/changelog/2026-12-05-draft-doctor-test-timeout.md b/changelog/2026-12-05-draft-doctor-test-timeout.md new file mode 100644 index 0000000000..f172384d1a --- /dev/null +++ b/changelog/2026-12-05-draft-doctor-test-timeout.md @@ -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. diff --git a/scripts/module-doctor.test.mjs b/scripts/module-doctor.test.mjs index 16d45f74e7..e5a4f77735 100644 --- a/scripts/module-doctor.test.mjs +++ b/scripts/module-doctor.test.mjs @@ -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. @@ -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', () => {