merge: origin/main into next for the 0.0.50 integration line
next carries 108 commits main lacks; main carries 23 next lacks, including the MOSAIC_GIT_IDENTITY work that per-agent git credentials depend on. Neither stream alone can ship 0.0.50: next drops identity, main drops everything since the split. Conflicts and how they were settled: - packages/mosaic/package.json test:framework-shell -- union. Neither side removed an entry; next added 6, main added 8, one shared. 50 total. - framework/tools/git/pr-merge.sh -- next's form. It permits base 'main' or 'next'; main's permits 'main' only, and the release line targets next. - framework/tools/git/test-ci-queue-wait-tristate.sh -- both sides appended to the same region (next: merge-readiness assertions; main: a real-clock watchdog control). Kept both. - docs/SITEMAP.md -- both sides appended distinct sections. Kept both.
This commit is contained in:
@@ -245,9 +245,21 @@ describe('EnrollmentService.createToken', () => {
|
||||
const after = Date.now();
|
||||
|
||||
const expiresMs = new Date(result.expiresAt).getTime();
|
||||
// Should be at most 900s from now
|
||||
expect(expiresMs - before).toBeLessThanOrEqual(900_000 + 100);
|
||||
|
||||
// The property under test is CLAMPING: a 9999s request must come back as 900s.
|
||||
// The gap between clamped and unclamped is 9_099_000 ms, so the tolerance below
|
||||
// only has to exceed CI scheduling jitter — it does not need to be tight to keep
|
||||
// the assertion discriminating. A 5s allowance consumes 0.05% of that margin and
|
||||
// an unclamped result still misses by three orders of magnitude.
|
||||
//
|
||||
// It was 100ms and failed on a loaded agent at 900_106 — 6ms over (#1090). A
|
||||
// wall-clock budget sized to a fast machine is a flake, not a tighter test.
|
||||
const CI_JITTER_MS = 5_000;
|
||||
expect(expiresMs - before).toBeLessThanOrEqual(900_000 + CI_JITTER_MS);
|
||||
expect(expiresMs - after).toBeGreaterThanOrEqual(0);
|
||||
// Explicitly pin the clamp itself, independent of any timing allowance:
|
||||
// unclamped (9999s) would exceed this by ~9_099_000 ms.
|
||||
expect(expiresMs - before).toBeLessThan(1_000_000);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user