Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: retain setup phase evidence in quiet browser runs (#13239)

Adam Eivyaf4345db8c98
diff --git a/server/test/ownedFixtureSetup.js b/server/test/ownedFixtureSetup.js
index 4f89a4134a..0180e512d3 100644
--- a/server/test/ownedFixtureSetup.js
+++ b/server/test/ownedFixtureSetup.js
@@ -4,7 +4,9 @@ import { browserCleanupDeadline } from '../../scripts/lib/ownedBrowserCleanup.js
* Phase operations must retain acquired resources before returning. close()
* stops admission immediately, then waits for that continuation before cleanup.
*/
-export function createOwnedFixtureSetup({ cleanup, timeoutMs = 30000, report = message => console.log(message) }) {
+// CI silences console methods; retain these bounded, redacted phase summaries
+// even when Vitest's hook deadline wins the race with our own deadline.
+export function createOwnedFixtureSetup({ cleanup, timeoutMs = 30000, report = message => process.stdout.write(`${message}\n`) }) {
let task, closing, started, stopped = false, active = 'not-started';
const phases = [];
const elapsed = () => Math.max(0, Math.round(performance.now() - started));
diff --git a/server/test/ownedFixtureSetup.test.js b/server/test/ownedFixtureSetup.test.js
index 7542fc6ff2..c08f8d340a 100644
--- a/server/test/ownedFixtureSetup.test.js
+++ b/server/test/ownedFixtureSetup.test.js
@@ -84,6 +84,21 @@ describe('whole fixture setup ownership', () => {
expect(vi.getTimerCount()).toBe(0);
});
+ it('retains phase evidence when CI silences console output', async () => {
+ const log = vi.spyOn(console, 'log').mockImplementation(() => {});
+ const output = vi.spyOn(process.stdout, 'write').mockReturnValue(true);
+ const fixture = createOwnedFixtureSetup({ cleanup: vi.fn() });
+ try {
+ await expect(fixture.run(phase => phase('bundle', () => { throw new Error('private details'); }))).rejects.toThrow('private details');
+ await fixture.close();
+ const evidence = output.mock.calls.map(([message]) => message).join('');
+ expect(evidence).toContain('Fixture setup failed; phase=bundle');
+ expect(evidence).not.toContain('private details');
+ expect(evidence.length).toBeLessThan(512);
+ expect(log).not.toHaveBeenCalled();
+ } finally { output.mockRestore(); log.mockRestore(); }
+ });
+
it('keeps setup and cleanup failures distinct and emits only phase timing', async () => {
const initial = new Error('synthetic private path or launch details');
const cleanupFailure = new Error('synthetic cleanup failure');