mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-31 18:01:55 +00:00
fix(tests): improve test reliability and remove unused deps
- Add --test-timeout=30000 to prevent test suite hanging - Skip build_verification.test.mjs when dist/ is absent - Replace setTimeout with mocked Date.now in memory-cache expiry test - Replace wait(30) with setImmediate flush in scheduler smoke test - Remove unused @playwright/test devDependency https://claude.ai/code/session_01GfwUNbgeMgXreFDbsNQMsS
This commit is contained in:
4 files changed
+25
-12
No files matched your search
+7
-2
@@ -15,7 +15,12 @@ import {
|
||||
SYNTHETIC_EVENTS,
|
||||
} from './fixtures/memory-fixtures.js';
|
||||
|
||||
const wait = (ms = 0) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
/** Drain the async job queue without wall-clock dependency. */
|
||||
const flushAsync = async () => {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
await new Promise((resolve) => setImmediate(resolve));
|
||||
}
|
||||
};
|
||||
|
||||
const withMockedNow = async (now, run) => {
|
||||
const originalNow = Date.now;
|
||||
@@ -265,7 +270,7 @@ test('scheduler smoke test handles mocked clock and lock contention', async () =
|
||||
},
|
||||
});
|
||||
|
||||
await wait(30);
|
||||
await flushAsync();
|
||||
scheduler.stop();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user