Public: anyone can read this; the crew can change it.

Tests wait for a signal, not a clock: a ratchet on fixed sleeps in test/ #14333

opened this in answer to

Check · Review · Land · Live — No review yet. Next: reviewer, no review yet.

Ready to land

scout/forge:scout/14321-tests-wait-for-a-signal-not-a-clock-a-ra → main 1 commit fork

Review

Sign in to review this change.
4 files changed +1594 −0
docs/test-honesty.json added +1393
@@ -0,0 +1,1393 @@
1 {
2 "test/account-budget.test.ts": {
3 "sleep": 1
4 },
5 "test/account-ceiling-reserve.test.ts": {
6 "sleep": 1
7 },
8 "test/act-now.test.ts": {
9 "sleep": 1
10 },
11 "test/adapter-tui.test.ts": {
12 "timer": 1
13 },
14 "test/agents.test.ts": {
15 "timer": 3
16 },
17 "test/api-reference.test.ts": {
18 "sleep": 1
19 },
20 "test/app-domains.test.ts": {
21 "sleep": 2
22 },
23 "test/app-env.test.ts": {
24 "sleep": 1
25 },
26 "test/app-home-batched.test.ts": {
27 "timer": 1
28 },
29 "test/app-host-holding.test.ts": {
30 "sleep": 1
31 },
32 "test/app-pull-now.test.ts": {
33 "sleep": 2
34 },
35 "test/app-tty-sessions.test.ts": {
36 "sleep": 1
37 },
38 "test/app-variants.test.ts": {
39 "sleep": 2
40 },
41 "test/approve-here.test.ts": {
42 "sleep": 2
43 },
44 "test/apps-adversarial-grants.test.ts": {
45 "sleep": 1
46 },
47 "test/apps-adversarial-teardown.test.ts": {
48 "sleep": 3
49 },
50 "test/apps-adversarial.test.ts": {
51 "sleep": 2
52 },
53 "test/apps-archive-race.test.ts": {
54 "sleep": 3
55 },
56 "test/apps-build-preview.test.ts": {
57 "sleep": 1
58 },
59 "test/apps-busy.test.ts": {
60 "sleep": 2
61 },
62 "test/apps-handoff.test.ts": {
63 "sleep": 1
64 },
65 "test/apps-idle.test.ts": {
66 "sleep": 1
67 },
68 "test/apps-pill-side.test.ts": {
69 "timer": 1
70 },
71 "test/apps-proxy-timing.test.ts": {
72 "sleep": 2
73 },
74 "test/apps-require-checks-green.test.ts": {
75 "sleep": 1
76 },
77 "test/apps-rollout.test.ts": {
78 "sleep": 6
79 },
80 "test/apps-sleep-slider.test.ts": {
81 "sleep": 4
82 },
83 "test/apps-sleep.test.ts": {
84 "sleep": 1
85 },
86 "test/apps-slow-test.test.ts": {
87 "sleep": 1
88 },
89 "test/apps-ssh.test.ts": {
90 "sleep": 4
91 },
92 "test/apps-stop-tree.test.ts": {
93 "sleep": 1
94 },
95 "test/apps-template-doors.test.ts": {
96 "sleep": 1
97 },
98 "test/apps-tests-clause.test.ts": {
99 "sleep": 1
100 },
101 "test/apps-token.test.ts": {
102 "sleep": 2
103 },
104 "test/apps-toolbar-tell.test.ts": {
105 "timer": 2
106 },
107 "test/apps-toolbar-yours.test.ts": {
108 "timer": 1
109 },
110 "test/apps-toolbar.test.ts": {
111 "sleep": 4
112 },
113 "test/apps-ws.test.ts": {
114 "sleep": 2
115 },
116 "test/apps.test.ts": {
117 "sleep": 4
118 },
119 "test/atom-feeds.test.ts": {
120 "sleep": 2
121 },
122 "test/authors-pull.test.ts": {
123 "sleep": 1
124 },
125 "test/autonomy_sweep.test.ts": {
126 "sleep": 1
127 },
128 "test/awake-room-hosted.test.ts": {
129 "sleep": 4
130 },
131 "test/awake-room.test.ts": {
132 "sleep": 1
133 },
134 "test/backup-truth.test.ts": {
135 "sleep": 4
136 },
137 "test/backups-live.test.ts": {
138 "sleep": 3
139 },
140 "test/bet-cap.test.ts": {
141 "sleep": 2
142 },
143 "test/big-clone.test.ts": {
144 "sleep": 3
145 },
146 "test/billing-replay.test.ts": {
147 "sleep": 2
148 },
149 "test/boards-healthz-gap.test.ts": {
150 "sleep": 1
151 },
152 "test/boot-beside-peer.test.ts": {
153 "sleep": 3
154 },
155 "test/boot-no-stall.test.ts": {
156 "timer": 1
157 },
158 "test/boot-production.test.ts": {
159 "sleep": 4
160 },
161 "test/boundary-fork-objects.test.ts": {
162 "sleep": 2
163 },
164 "test/boundary-outbound.test.ts": {
165 "sleep": 1
166 },
167 "test/boundary-pull-egress.test.ts": {
168 "sleep": 1
169 },
170 "test/boundary-secrets-process.test.ts": {
171 "sleep": 2
172 },
173 "test/boundary-tokens-apphost.test.ts": {
174 "sleep": 1
175 },
176 "test/boundary-tokens-crew.test.ts": {
177 "sleep": 1
178 },
179 "test/bring-oauth-return.test.ts": {
180 "sleep": 1
181 },
182 "test/build-cart.test.ts": {
183 "sleep": 1
184 },
185 "test/build-journey.test.ts": {
186 "sleep": 2
187 },
188 "test/build-limits.test.ts": {
189 "sleep": 1
190 },
191 "test/capacity.test.ts": {
192 "sleep": 7
193 },
194 "test/carried-deploy.test.ts": {
195 "sleep": 1
196 },
197 "test/cell-outlives-host.test.ts": {
198 "sleep": 5
199 },
200 "test/cell-relays-reaped.test.ts": {
201 "sleep": 2
202 },
203 "test/cell-stopped-dies-with-forge.test.ts": {
204 "sleep": 1
205 },
206 "test/cgroup.test.ts": {
207 "sleep": 1
208 },
209 "test/changelog-atom.test.ts": {
210 "sleep": 1
211 },
212 "test/chapters.test.ts": {
213 "timer": 1
214 },
215 "test/check-base-moved.test.ts": {
216 "sleep": 1
217 },
218 "test/check-budget.test.ts": {
219 "sleep": 2
220 },
221 "test/check-disk-hold.test.ts": {
222 "sleep": 2
223 },
224 "test/check-disk-used.test.ts": {
225 "sleep": 1
226 },
227 "test/check-flake.test.ts": {
228 "sleep": 1
229 },
230 "test/check-install.test.ts": {
231 "sleep": 3
232 },
233 "test/check-land-main.test.ts": {
234 "sleep": 1
235 },
236 "test/check-land-settle.test.ts": {
237 "sleep": 1
238 },
239 "test/check-memory-warning.test.ts": {
240 "sleep": 2
241 },
242 "test/check-order-dependent.test.ts": {
243 "sleep": 3
244 },
245 "test/check-pod-too-small.test.ts": {
246 "sleep": 1
247 },
248 "test/check-proven.test.ts": {
249 "retry": 2
250 },
251 "test/check-pull-flake.test.ts": {
252 "sleep": 1
253 },
254 "test/check-reclaim-full-disk.test.ts": {
255 "sleep": 1
256 },
257 "test/check-stale-gate.test.ts": {
258 "sleep": 1
259 },
260 "test/check-stale-wiring.test.ts": {
261 "sleep": 1
262 },
263 "test/check-tiers.test.ts": {
264 "sleep": 8
265 },
266 "test/check-verify-rerun.test.ts": {
267 "sleep": 1
268 },
269 "test/check-verify.test.ts": {
270 "sleep": 1
271 },
272 "test/checks-job-vanish.test.ts": {
273 "sleep": 1
274 },
275 "test/checks-one-core.test.ts": {
276 "sleep": 4
277 },
278 "test/checks-placement.test.ts": {
279 "sleep": 1
280 },
281 "test/checks.test.ts": {
282 "sleep": 1
283 },
284 "test/child-credit.test.ts": {
285 "sleep": 4
286 },
287 "test/client-abort.test.ts": {
288 "sleep": 5
289 },
290 "test/client-list.test.ts": {
291 "sleep": 1
292 },
293 "test/codes-tui.test.ts": {
294 "timer": 1
295 },
296 "test/combined-check.test.ts": {
297 "sleep": 2
298 },
299 "test/combined-fork.test.ts": {
300 "sleep": 1
301 },
302 "test/composer-draft.test.ts": {
303 "sleep": 2
304 },
305 "test/conflicts-tui.test.ts": {
306 "sleep": 3
307 },
308 "test/contain.test.ts": {
309 "sleep": 6
310 },
311 "test/contribute-check-text.test.ts": {
312 "sleep": 2
313 },
314 "test/conversation-confirm.test.ts": {
315 "timer": 1
316 },
317 "test/conversation-files.test.ts": {
318 "sleep": 1,
319 "timer": 1
320 },
321 "test/conversation-queue-api.test.ts": {
322 "sleep": 1
323 },
324 "test/conversation-queue.test.ts": {
325 "sleep": 1
326 },
327 "test/conversation-talk.test.ts": {
328 "sleep": 3
329 },
330 "test/conversation-turn.test.ts": {
331 "sleep": 7
332 },
333 "test/conversations-etag.test.ts": {
334 "sleep": 1
335 },
336 "test/credentials.test.ts": {
337 "sleep": 1
338 },
339 "test/crew-cancel-by.test.ts": {
340 "sleep": 1
341 },
342 "test/crew-cancel-group.test.ts": {
343 "sleep": 3
344 },
345 "test/crew-cancel-shell.test.ts": {
346 "sleep": 2
347 },
348 "test/crew-check-cpu-stop.test.ts": {
349 "sleep": 2
350 },
351 "test/crew-check-failed.test.ts": {
352 "sleep": 1
353 },
354 "test/crew-closed.test.ts": {
355 "sleep": 2
356 },
357 "test/crew-direction.test.ts": {
358 "sleep": 1
359 },
360 "test/crew-early.test.ts": {
361 "sleep": 10
362 },
363 "test/crew-feedback.test.ts": {
364 "sleep": 2
365 },
366 "test/crew-guard.test.ts": {
367 "sleep": 8
368 },
369 "test/crew-lent-refresh.test.ts": {
370 "sleep": 1
371 },
372 "test/crew-loop.test.ts": {
373 "sleep": 1,
374 "timer": 3
375 },
376 "test/crew-merge-conflict.test.ts": {
377 "timer": 1
378 },
379 "test/crew-mirror.test.ts": {
380 "sleep": 5
381 },
382 "test/crew-network.test.ts": {
383 "sleep": 3
384 },
385 "test/crew-own-forge.test.ts": {
386 "sleep": 3
387 },
388 "test/crew-parks-done.test.ts": {
389 "sleep": 3
390 },
391 "test/crew-parks-planner.test.ts": {
392 "sleep": 5
393 },
394 "test/crew-proposal.test.ts": {
395 "sleep": 4
396 },
397 "test/crew-red-outside-diff.test.ts": {
398 "sleep": 2
399 },
400 "test/crew-remotes.test.ts": {
401 "sleep": 1
402 },
403 "test/crew-reserve.test.ts": {
404 "sleep": 2
405 },
406 "test/crew-retry.test.ts": {
407 "sleep": 1
408 },
409 "test/crew-run-timing.test.ts": {
410 "sleep": 1
411 },
412 "test/crew-sandbox.test.ts": {
413 "sleep": 1
414 },
415 "test/crew-stalls.test.ts": {
416 "timer": 1
417 },
418 "test/crew-tick.test.ts": {
419 "sleep": 2
420 },
421 "test/crew-wrapup.test.ts": {
422 "sleep": 1
423 },
424 "test/desk-api.test.ts": {
425 "sleep": 3
426 },
427 "test/disk-floor.test.ts": {
428 "sleep": 1
429 },
430 "test/door-pulls.test.ts": {
431 "sleep": 1
432 },
433 "test/drill-board-line.test.ts": {
434 "sleep": 2
435 },
436 "test/drill-budget-size.test.ts": {
437 "sleep": 1
438 },
439 "test/drill-job.test.ts": {
440 "sleep": 1
441 },
442 "test/drill-parts.test.ts": {
443 "timer": 1
444 },
445 "test/drill-run.test.ts": {
446 "sleep": 2
447 },
448 "test/drill-weekly.test.ts": {
449 "sleep": 8
450 },
451 "test/drop-doors.test.ts": {
452 "timer": 1
453 },
454 "test/egress-admin.test.ts": {
455 "sleep": 1
456 },
457 "test/egress-leak.test.ts": {
458 "sleep": 1
459 },
460 "test/egress-metrics-route.test.ts": {
461 "sleep": 1
462 },
463 "test/egress-totals.test.ts": {
464 "sleep": 1
465 },
466 "test/engine-split-soak.test.ts": {
467 "sleep": 1
468 },
469 "test/engine-split.test.ts": {
470 "sleep": 5
471 },
472 "test/event-audience.test.ts": {
473 "sleep": 4
474 },
475 "test/events-run-log.test.ts": {
476 "sleep": 1
477 },
478 "test/feed-like.test.ts": {
479 "timer": 2
480 },
481 "test/feed-team-waits.test.ts": {
482 "sleep": 1
483 },
484 "test/finishing-room.test.ts": {
485 "sleep": 1
486 },
487 "test/finishing.test.ts": {
488 "sleep": 1
489 },
490 "test/first-five-minutes-journey.test.ts": {
491 "sleep": 1
492 },
493 "test/first-ten-minutes.test.ts": {
494 "sleep": 4
495 },
496 "test/first_look.test.ts": {
497 "sleep": 2
498 },
499 "test/fixtures/cache-under.ts": {
500 "mock": 1
501 },
502 "test/fixtures/shard-crash-once.test.ts": {
503 "sleep": 1
504 },
505 "test/flake.test.ts": {
506 "sleep": 8,
507 "retry": 1
508 },
509 "test/flow-clog-door.test.ts": {
510 "sleep": 2
511 },
512 "test/flows.test.ts": {
513 "sleep": 2
514 },
515 "test/following-card.test.ts": {
516 "sleep": 1
517 },
518 "test/following-incoming.test.ts": {
519 "sleep": 1
520 },
521 "test/following.test.ts": {
522 "sleep": 6
523 },
524 "test/footing.test.ts": {
525 "sleep": 4
526 },
527 "test/forge-archive.test.ts": {
528 "sleep": 1
529 },
530 "test/forge-cloudflare-celld.test.ts": {
531 "sleep": 1
532 },
533 "test/forge-link-reissue.test.ts": {
534 "sleep": 1
535 },
536 "test/forge-origin-oauth.test.ts": {
537 "sleep": 1
538 },
539 "test/forge-recovery.test.ts": {
540 "sleep": 2
541 },
542 "test/forge-signin.test.ts": {
543 "sleep": 1
544 },
545 "test/forge-sleep.test.ts": {
546 "sleep": 1
547 },
548 "test/forges-side-by-side.test.ts": {
549 "sleep": 2
550 },
551 "test/fork-chain.test.ts": {
552 "sleep": 1
553 },
554 "test/fork-follow-conflict.test.ts": {
555 "sleep": 1
556 },
557 "test/fork-follow-mode.test.ts": {
558 "sleep": 3
559 },
560 "test/fork-pull-approval.test.ts": {
561 "sleep": 4
562 },
563 "test/fork-sever.test.ts": {
564 "sleep": 1
565 },
566 "test/fork-standing-line.test.ts": {
567 "sleep": 2
568 },
569 "test/forks-ranking.test.ts": {
570 "sleep": 1
571 },
572 "test/front.test.ts": {
573 "sleep": 1
574 },
575 "test/full-disk.test.ts": {
576 "sleep": 2
577 },
578 "test/gate-drain.test.ts": {
579 "sleep": 2
580 },
581 "test/gate-interrupted.test.ts": {
582 "sleep": 1
583 },
584 "test/gate-last-slot.test.ts": {
585 "sleep": 2
586 },
587 "test/gate-update-pull.test.ts": {
588 "sleep": 1
589 },
590 "test/git-pace-wiring.test.ts": {
591 "sleep": 2
592 },
593 "test/git-ssh.test.ts": {
594 "sleep": 1
595 },
596 "test/guest-pull-env.test.ts": {
597 "sleep": 1
598 },
599 "test/guest-pull.test.ts": {
600 "sleep": 1
601 },
602 "test/handover-give-back.test.ts": {
603 "sleep": 1
604 },
605 "test/hardening.test.ts": {
606 "sleep": 2
607 },
608 "test/health-vitals-reuse.test.ts": {
609 "sleep": 1
610 },
611 "test/helpers/apps-forge.ts": {
612 "sleep": 2
613 },
614 "test/helpers/cell-looks-e2e.ts": {
615 "sleep": 1
616 },
617 "test/helpers/cell-probe.ts": {
618 "sleep": 1
619 },
620 "test/helpers/checks-forge.ts": {
621 "sleep": 2
622 },
623 "test/helpers/chrome.ts": {
624 "sleep": 3
625 },
626 "test/helpers/handover-roll.ts": {
627 "sleep": 6
628 },
629 "test/helpers/overlap-worker.ts": {
630 "sleep": 2
631 },
632 "test/helpers/poll.ts": {
633 "sleep": 1
634 },
635 "test/helpers/pull-goes-back.ts": {
636 "sleep": 1
637 },
638 "test/helpers/real-child-forge.ts": {
639 "sleep": 1
640 },
641 "test/helpers/real-move-e2e.ts": {
642 "sleep": 1
643 },
644 "test/helpers/real-stranger-e2e.ts": {
645 "sleep": 1
646 },
647 "test/helpers/tui.ts": {
648 "timer": 1
649 },
650 "test/highlight.test.ts": {
651 "retry": 1
652 },
653 "test/holds.test.ts": {
654 "sleep": 1
655 },
656 "test/home-cache-ttl.test.ts": {
657 "timer": 2
658 },
659 "test/home-frame.test.ts": {
660 "sleep": 2
661 },
662 "test/home-memory.test.ts": {
663 "sleep": 1
664 },
665 "test/hook-ping.test.ts": {
666 "sleep": 1
667 },
668 "test/hooks-etag.test.ts": {
669 "sleep": 1
670 },
671 "test/issue-teams-hold.test.ts": {
672 "sleep": 1
673 },
674 "test/issue-teams.test.ts": {
675 "sleep": 1
676 },
677 "test/jobs-doors.test.ts": {
678 "timer": 3
679 },
680 "test/landing.test.ts": {
681 "sleep": 1
682 },
683 "test/live-hold.test.ts": {
684 "timer": 1
685 },
686 "test/live.test.ts": {
687 "sleep": 1
688 },
689 "test/look-named-not-dropped.test.ts": {
690 "sleep": 1
691 },
692 "test/look-pages-comment.test.ts": {
693 "sleep": 2
694 },
695 "test/looks-one-core.test.ts": {
696 "sleep": 1
697 },
698 "test/looks-owner.test.ts": {
699 "sleep": 2
700 },
701 "test/looks.test.ts": {
702 "sleep": 3
703 },
704 "test/loop-stall.test.ts": {
705 "sleep": 2
706 },
707 "test/loop-worst.test.ts": {
708 "timer": 1
709 },
710 "test/machine-shell.test.ts": {
711 "sleep": 5
712 },
713 "test/maintain-evidence.test.ts": {
714 "sleep": 1
715 },
716 "test/maintain.test.ts": {
717 "timer": 1
718 },
719 "test/maintenance-crew.test.ts": {
720 "sleep": 1
721 },
722 "test/maintenance.test.ts": {
723 "sleep": 2
724 },
725 "test/mcp-csp-violations.test.ts": {
726 "sleep": 1
727 },
728 "test/mcp-ops-tool-cards.test.ts": {
729 "sleep": 1
730 },
731 "test/mcp-org-teams-waiting.test.ts": {
732 "sleep": 1
733 },
734 "test/mcp-restore-drill.test.ts": {
735 "sleep": 1
736 },
737 "test/media.test.ts": {
738 "sleep": 2
739 },
740 "test/memory-hold.test.ts": {
741 "sleep": 1
742 },
743 "test/merge-queue-batch.test.ts": {
744 "sleep": 3
745 },
746 "test/merge-queue-clash.test.ts": {
747 "sleep": 2
748 },
749 "test/merge-queue-hold.test.ts": {
750 "sleep": 2
751 },
752 "test/merge-queue-parallel.test.ts": {
753 "sleep": 4
754 },
755 "test/merge-queue-restart.test.ts": {
756 "sleep": 7
757 },
758 "test/merge-queue-suspect.test.ts": {
759 "sleep": 1
760 },
761 "test/merge-queue.test.ts": {
762 "sleep": 2
763 },
764 "test/meter.test.ts": {
765 "sleep": 2
766 },
767 "test/migrate-token-reach.test.ts": {
768 "sleep": 1
769 },
770 "test/migration-doors.test.ts": {
771 "timer": 1
772 },
773 "test/mirror-out.test.ts": {
774 "sleep": 2
775 },
776 "test/model-grant.test.ts": {
777 "sleep": 1
778 },
779 "test/my-shells.test.ts": {
780 "sleep": 9
781 },
782 "test/needs-fixes.test.ts": {
783 "timer": 1
784 },
785 "test/nightly.test.ts": {
786 "sleep": 2
787 },
788 "test/no-polling.test.ts": {
789 "timer": 2
790 },
791 "test/notes.test.ts": {
792 "sleep": 1
793 },
794 "test/notify-causes.test.ts": {
795 "timer": 3
796 },
797 "test/offer-commit-tui.test.ts": {
798 "sleep": 2
799 },
800 "test/og-png.test.ts": {
801 "sleep": 1
802 },
803 "test/onboarding-doors.test.ts": {
804 "timer": 1
805 },
806 "test/origin-ahead.test.ts": {
807 "sleep": 1
808 },
809 "test/origin-pull-state.test.ts": {
810 "sleep": 1
811 },
812 "test/origins-sync-settled.test.ts": {
813 "sleep": 1
814 },
815 "test/orphan-dispatch.test.ts": {
816 "sleep": 1
817 },
818 "test/outsiders-member.test.ts": {
819 "sleep": 1
820 },
821 "test/overlap.test.ts": {
822 "sleep": 2
823 },
824 "test/overlay-host.test.ts": {
825 "timer": 3
826 },
827 "test/own-code.test.ts": {
828 "sleep": 1
829 },
830 "test/pace-floor.test.ts": {
831 "sleep": 1
832 },
833 "test/packs-mirror.test.ts": {
834 "timer": 1
835 },
836 "test/packs-up.test.ts": {
837 "sleep": 1
838 },
839 "test/parent-releases-idle.test.ts": {
840 "sleep": 1
841 },
842 "test/parked-close.test.ts": {
843 "sleep": 1
844 },
845 "test/perf-duty.test.ts": {
846 "sleep": 4
847 },
848 "test/perf-server-hook.test.ts": {
849 "sleep": 1
850 },
851 "test/perf-stall-blame.test.ts": {
852 "timer": 2
853 },
854 "test/pinned-forge-address.test.ts": {
855 "timer": 1
856 },
857 "test/pinned-forge-recovery.test.ts": {
858 "timer": 2
859 },
860 "test/preview-spec.test.ts": {
861 "sleep": 1
862 },
863 "test/probe.test.ts": {
864 "sleep": 2
865 },
866 "test/probes.test.ts": {
867 "sleep": 1
868 },
869 "test/prompts.test.ts": {
870 "sleep": 1
871 },
872 "test/proposal-run.test.ts": {
873 "sleep": 5
874 },
875 "test/protection.test.ts": {
876 "retry": 1
877 },
878 "test/pull-head-refresh.test.ts": {
879 "mock": 2
880 },
881 "test/pull-next-tui.test.ts": {
882 "sleep": 1
883 },
884 "test/pull-pipe.test.ts": {
885 "sleep": 2
886 },
887 "test/pull-red-alone-path.test.ts": {
888 "sleep": 1
889 },
890 "test/pull-schedule.test.ts": {
891 "sleep": 1
892 },
893 "test/pull-tui-check-tick.test.ts": {
894 "sleep": 1
895 },
896 "test/pull-variants.test.ts": {
897 "sleep": 2
898 },
899 "test/question-api.test.ts": {
900 "timer": 1
901 },
902 "test/quotas-running.test.ts": {
903 "sleep": 1
904 },
905 "test/quotas-storage.test.ts": {
906 "sleep": 3
907 },
908 "test/reading-gives-up.test.ts": {
909 "timer": 1
910 },
911 "test/rebase-lane.test.ts": {
912 "sleep": 1
913 },
914 "test/recheck-window-door.test.ts": {
915 "sleep": 1
916 },
917 "test/release-handover-keepalive.test.ts": {
918 "sleep": 1,
919 "timer": 1
920 },
921 "test/release-journey.test.ts": {
922 "sleep": 1
923 },
924 "test/release-keeper-swap.test.ts": {
925 "sleep": 6
926 },
927 "test/release-later-script.test.ts": {
928 "sleep": 1
929 },
930 "test/release-launch.test.ts": {
931 "sleep": 5
932 },
933 "test/release-prove.test.ts": {
934 "sleep": 12
935 },
936 "test/release-swap.test.ts": {
937 "sleep": 4
938 },
939 "test/render-image.test.ts": {
940 "timer": 1
941 },
942 "test/render-subtitles-shift.test.ts": {
943 "timer": 1
944 },
945 "test/repo-transfer-follow.test.ts": {
946 "sleep": 1,
947 "timer": 1
948 },
949 "test/retention-jobs.test.ts": {
950 "timer": 3
951 },
952 "test/roll-write-pause.test.ts": {
953 "sleep": 2
954 },
955 "test/run-cancel-ended.test.ts": {
956 "sleep": 1
957 },
958 "test/run-cancel-stopping.test.ts": {
959 "sleep": 2
960 },
961 "test/run-cancel-tree.test.ts": {
962 "sleep": 4
963 },
964 "test/run-cancel.test.ts": {
965 "sleep": 1
966 },
967 "test/run-state.test.ts": {
968 "sleep": 1
969 },
970 "test/runner-measure.test.ts": {
971 "sleep": 1
972 },
973 "test/runs-log-buffered.test.ts": {
974 "sleep": 1
975 },
976 "test/sample.test.ts": {
977 "timer": 2
978 },
979 "test/scaffold-webspec.test.ts": {
980 "sleep": 1
981 },
982 "test/scaffold.test.ts": {
983 "sleep": 1
984 },
985 "test/sealed-release.test.ts": {
986 "sleep": 1
987 },
988 "test/search-batch-race.test.ts": {
989 "timer": 2
990 },
991 "test/secrets-never-surface.test.ts": {
992 "sleep": 2
993 },
994 "test/serving-priority.test.ts": {
995 "sleep": 6
996 },
997 "test/session-reap.test.ts": {
998 "sleep": 1
999 },
1000 "test/session-settle.test.ts": {
1001 "sleep": 2
1002 },
1003 "test/shards-run.test.ts": {
1004 "sleep": 1
1005 },
1006 "test/signin-page.test.ts": {
1007 "timer": 1
1008 },
1009 "test/signin-password-doors.test.ts": {
1010 "sleep": 2
1011 },
1012 "test/signup-fresh.test.ts": {
1013 "sleep": 1
1014 },
1015 "test/snapshot-destination.test.ts": {
1016 "sleep": 2
1017 },
1018 "test/snapshot-drill-page.test.ts": {
1019 "sleep": 2
1020 },
1021 "test/snapshot-one-core.test.ts": {
1022 "sleep": 2
1023 },
1024 "test/snapshot-outcome.test.ts": {
1025 "sleep": 2
1026 },
1027 "test/snapshot-restore-clones.test.ts": {
1028 "sleep": 2
1029 },
1030 "test/snapshot-restore-packed.test.ts": {
1031 "sleep": 1
1032 },
1033 "test/snapshot-restore-streamed.test.ts": {
1034 "sleep": 6
1035 },
1036 "test/snapshot-slow-line.test.ts": {
1037 "sleep": 1
1038 },
1039 "test/snapshot-uploads.test.ts": {
1040 "sleep": 4
1041 },
1042 "test/spawn-app-links.test.ts": {
1043 "sleep": 1
1044 },
1045 "test/spawn-births.test.ts": {
1046 "sleep": 7
1047 },
1048 "test/spawn-cell-socket.test.ts": {
1049 "sleep": 1
1050 },
1051 "test/spawn-cell-stopping.test.ts": {
1052 "sleep": 1
1053 },
1054 "test/spawn-cell.test.ts": {
1055 "sleep": 4
1056 },
1057 "test/spawn-chain.test.ts": {
1058 "sleep": 1
1059 },
1060 "test/spawn-child-runs-apps.test.ts": {
1061 "sleep": 1
1062 },
1063 "test/spawn-events.test.ts": {
1064 "sleep": 2
1065 },
1066 "test/spawn-gate-e2e.test.ts": {
1067 "retry": 1
1068 },
1069 "test/spawn-limits-listed.test.ts": {
1070 "sleep": 1
1071 },
1072 "test/spawn-live.test.ts": {
1073 "sleep": 2
1074 },
1075 "test/spawn-move-cell-sizes.test.ts": {
1076 "sleep": 1
1077 },
1078 "test/spawn-reach-door.test.ts": {
1079 "sleep": 1
1080 },
1081 "test/spawn-sleep-together.test.ts": {
1082 "sleep": 1
1083 },
1084 "test/spawn-stopped-restart.test.ts": {
1085 "sleep": 4
1086 },
1087 "test/spawn-stranger-cell.test.ts": {
1088 "retry": 1
1089 },
1090 "test/ssh-app.test.ts": {
1091 "sleep": 5
1092 },
1093 "test/ssh-door-limits.test.ts": {
1094 "sleep": 2,
1095 "timer": 1
1096 },
1097 "test/ssh-handover.test.ts": {
1098 "sleep": 1
1099 },
1100 "test/ssh-port-taken.test.ts": {
1101 "sleep": 1
1102 },
1103 "test/ssh-shell-cold.test.ts": {
1104 "sleep": 3
1105 },
1106 "test/ssh.test.ts": {
1107 "sleep": 3
1108 },
1109 "test/stall-in-flight.test.ts": {
1110 "sleep": 1
1111 },
1112 "test/standby-restore.test.ts": {
1113 "sleep": 1
1114 },
1115 "test/standing-every-process.test.ts": {
1116 "sleep": 1
1117 },
1118 "test/standing-rule.test.ts": {
1119 "sleep": 1
1120 },
1121 "test/start.test.ts": {
1122 "sleep": 1
1123 },
1124 "test/steer.test.ts": {
1125 "sleep": 1
1126 },
1127 "test/steps-stop-tree.test.ts": {
1128 "sleep": 2
1129 },
1130 "test/stranger-first-ask-journey.test.ts": {
1131 "sleep": 1
1132 },
1133 "test/stranger-pull.test.ts": {
1134 "sleep": 2
1135 },
1136 "test/stranger-three-screens.test.ts": {
1137 "timer": 3
1138 },
1139 "test/stripe-hook.test.ts": {
1140 "sleep": 3
1141 },
1142 "test/stuck-pile-doors.test.ts": {
1143 "timer": 1
1144 },
1145 "test/subscriptions.test.ts": {
1146 "sleep": 1
1147 },
1148 "test/support/landsim.ts": {
1149 "sleep": 1
1150 },
1151 "test/surfaces-adversarial.test.ts": {
1152 "timer": 1
1153 },
1154 "test/talk-build.test.ts": {
1155 "sleep": 1
1156 },
1157 "test/talk-page.test.ts": {
1158 "sleep": 2,
1159 "timer": 5
1160 },
1161 "test/talk-slash.test.ts": {
1162 "sleep": 1
1163 },
1164 "test/talk-stop.test.ts": {
1165 "sleep": 2
1166 },
1167 "test/team-dispatch.test.ts": {
1168 "sleep": 1
1169 },
1170 "test/team-merge-gate.test.ts": {
1171 "sleep": 1
1172 },
1173 "test/team-queue.test.ts": {
1174 "sleep": 1
1175 },
1176 "test/templates-boot.test.ts": {
1177 "sleep": 1
1178 },
1179 "test/test-budget-run.test.ts": {
1180 "sleep": 1
1181 },
1182 "test/thanks.test.ts": {
1183 "sleep": 1
1184 },
1185 "test/timers-sync.test.ts": {
1186 "sleep": 2
1187 },
1188 "test/toolbar-keyboard.test.ts": {
1189 "sleep": 1
1190 },
1191 "test/toolbar-move.test.ts": {
1192 "sleep": 1
1193 },
1194 "test/tree-read.test.ts": {
1195 "sleep": 5
1196 },
1197 "test/tty-stop-tree.test.ts": {
1198 "sleep": 2
1199 },
1200 "test/tui-about-default-branch.test.ts": {
1201 "sleep": 4
1202 },
1203 "test/tui-about-description.test.ts": {
1204 "sleep": 4
1205 },
1206 "test/tui-about-detach.test.ts": {
1207 "sleep": 1
1208 },
1209 "test/tui-about-outsiders.test.ts": {
1210 "sleep": 1
1211 },
1212 "test/tui-about-visibility.test.ts": {
1213 "sleep": 2
1214 },
1215 "test/tui-app-templates.test.ts": {
1216 "sleep": 3
1217 },
1218 "test/tui-app.test.ts": {
1219 "sleep": 2
1220 },
1221 "test/tui-appbackup.test.ts": {
1222 "sleep": 1
1223 },
1224 "test/tui-apps.test.ts": {
1225 "sleep": 1,
1226 "timer": 1
1227 },
1228 "test/tui-autonomy.test.ts": {
1229 "timer": 1
1230 },
1231 "test/tui-backups-test.test.ts": {
1232 "sleep": 1
1233 },
1234 "test/tui-backups.test.ts": {
1235 "sleep": 1
1236 },
1237 "test/tui-changelog-find.test.ts": {
1238 "timer": 1
1239 },
1240 "test/tui-changelog-waves.test.ts": {
1241 "timer": 1
1242 },
1243 "test/tui-claim-start.test.ts": {
1244 "sleep": 1
1245 },
1246 "test/tui-code.test.ts": {
1247 "sleep": 1
1248 },
1249 "test/tui-delete-repo.test.ts": {
1250 "timer": 1
1251 },
1252 "test/tui-devices.test.ts": {
1253 "sleep": 1
1254 },
1255 "test/tui-drill.test.ts": {
1256 "sleep": 1
1257 },
1258 "test/tui-editor.test.ts": {
1259 "timer": 1
1260 },
1261 "test/tui-fleet.test.ts": {
1262 "sleep": 3
1263 },
1264 "test/tui-following.test.ts": {
1265 "sleep": 1
1266 },
1267 "test/tui-forgeview-live.test.ts": {
1268 "sleep": 2
1269 },
1270 "test/tui-forks-propose.test.ts": {
1271 "sleep": 1
1272 },
1273 "test/tui-forks-take.test.ts": {
1274 "sleep": 1
1275 },
1276 "test/tui-hooks-deliveries.test.ts": {
1277 "timer": 1
1278 },
1279 "test/tui-hooks.test.ts": {
1280 "timer": 3
1281 },
1282 "test/tui-issue-flow-first.test.ts": {
1283 "timer": 1
1284 },
1285 "test/tui-limbs-replanned.test.ts": {
1286 "sleep": 1
1287 },
1288 "test/tui-limbs.test.ts": {
1289 "timer": 1
1290 },
1291 "test/tui-live-throw.test.ts": {
1292 "sleep": 1
1293 },
1294 "test/tui-machines.test.ts": {
1295 "sleep": 1
1296 },
1297 "test/tui-migrate.test.ts": {
1298 "timer": 1
1299 },
1300 "test/tui-milestone-watch.test.ts": {
1301 "sleep": 1
1302 },
1303 "test/tui-newapp.test.ts": {
1304 "sleep": 1
1305 },
1306 "test/tui-next-up.test.ts": {
1307 "timer": 2
1308 },
1309 "test/tui-origins-forge.test.ts": {
1310 "sleep": 2
1311 },
1312 "test/tui-origins-guard.test.ts": {
1313 "sleep": 1
1314 },
1315 "test/tui-origins.test.ts": {
1316 "sleep": 1
1317 },
1318 "test/tui-people-verify.test.ts": {
1319 "sleep": 1
1320 },
1321 "test/tui-resilience-drill.test.ts": {
1322 "sleep": 2
1323 },
1324 "test/tui-resilience-now.test.ts": {
1325 "sleep": 3
1326 },
1327 "test/tui-runlog.test.ts": {
1328 "timer": 2
1329 },
1330 "test/tui-screens.test.ts": {
1331 "timer": 1
1332 },
1333 "test/tui-size.test.ts": {
1334 "timer": 1
1335 },
1336 "test/tui-standing-line.test.ts": {
1337 "sleep": 1
1338 },
1339 "test/tui-steer.test.ts": {
1340 "sleep": 1
1341 },
1342 "test/tui-talk-build.test.ts": {
1343 "sleep": 2
1344 },
1345 "test/tui-talk-chats.test.ts": {
1346 "sleep": 1
1347 },
1348 "test/tui-transfer-repo.test.ts": {
1349 "timer": 1
1350 },
1351 "test/tui-variants.test.ts": {
1352 "timer": 1
1353 },
1354 "test/tui-workflows.test.ts": {
1355 "timer": 1
1356 },
1357 "test/tui-working-yours.test.ts": {
1358 "timer": 1
1359 },
1360 "test/upstream-forge.test.ts": {
1361 "sleep": 2
1362 },
1363 "test/usage-count.test.ts": {
1364 "sleep": 4
1365 },
1366 "test/usage.test.ts": {
1367 "sleep": 1
1368 },
1369 "test/variants-surfaces.test.ts": {
1370 "sleep": 1
1371 },
1372 "test/vitals-held-agent.test.ts": {
1373 "sleep": 1
1374 },
1375 "test/vitals.test.ts": {
1376 "sleep": 3
1377 },
1378 "test/watches.test.ts": {
1379 "sleep": 3
1380 },
1381 "test/web-apps.test.ts": {
1382 "sleep": 4
1383 },
1384 "test/web-ui.test.ts": {
1385 "timer": 2
1386 },
1387 "test/week-doors.test.ts": {
1388 "timer": 1
1389 },
1390 "test/week-pump.test.ts": {
1391 "sleep": 1
1392 }
1393 }
scripts/gate.ts +34
@@ -492,6 +492,35 @@ export function billingDeletesRefusal(root = "."): string[] {
492492 return destroyReachRefusal(root);
493493 }
494494
495 /** Every `.ts` under `root/test`, path to text: what the test-honesty ratchet counts. */
496 function testSources(root: string): Record<string, string> {
497 const dir = join(root, "test");
498 if (!existsSync(dir)) return {};
499 const out: Record<string, string> = {};
500 for (const f of (readdirSync(dir, { recursive: true }) as string[]).sort())
501 if (f.endsWith(".ts")) out[`test/${f}`] = readFileSync(join(dir, f), "utf8");
502 return out;
503 }
504
505 /**
506 * Fixed waits, `mock.module(` and test retries held to `docs/test-honesty.json` (#14321): see
507 * `src/kernel/test_honesty.ts`. A tree without the file (the gate's own fixtures) has no ratchet.
508 */
509 export function testHonestyRefusal(root = "."): string[] {
510 const { HONESTY_FILE, honestyProblems, measureHonesty, parseAllowance } = require("../src/kernel/test_honesty.ts") as typeof import("../src/kernel/test_honesty.ts");
511 const path = join(root, HONESTY_FILE);
512 if (!existsSync(path)) return [];
513 const allowed = parseAllowance(readFileSync(path, "utf8"));
514 if (typeof allowed === "string") return [allowed];
515 return honestyProblems(measureHonesty(testSources(root)), allowed);
516 }
517
518 /** `FORGE_SLEEP_WRITE=1`: the allowance rewritten to today's counts. */
519 export function writeTestHonesty(root = "."): void {
520 const { HONESTY_FILE, measureHonesty } = require("../src/kernel/test_honesty.ts") as typeof import("../src/kernel/test_honesty.ts");
521 writeFileSync(join(root, HONESTY_FILE), `${JSON.stringify(measureHonesty(testSources(root)), null, 2)}\n`);
522 }
523
495524 /** Review findings that repeated (#8888): see `src/kernel/review_rules.ts`. */
496525 export function reviewRefusal(root = "."): string[] {
497526 // Loaded by `require` so `treeGate`, which loads this file alone, never needs it.
@@ -837,6 +866,7 @@ export async function gateVerdict(cwd: string = process.cwd()): Promise<{ notes:
837866 ...(await dependencyRefusal(cwd)),
838867 ...(await readmeCapRefusal(cwd)),
839868 ...billingDeletesRefusal(cwd),
869 ...testHonestyRefusal(cwd),
840870 ];
841871 return { notes: [...wrapNote(cwd), ...(await lookNote(cwd)), ...(await tryItNote(cwd))], refusal };
842872 }
@@ -850,6 +880,10 @@ if (import.meta.main) {
850880 const fixed = wrapFix(".", process.argv.includes("--all"));
851881 if (fixed.length) console.error(`gate: rewrapped comments in ${fixed.length === 1 ? "1 file" : `${fixed.length} files`}; commit them`);
852882 }
883 if (process.env.FORGE_SLEEP_WRITE === "1") {
884 writeTestHonesty(".");
885 console.error("gate: rewrote docs/test-honesty.json to today's counts; commit it");
886 }
853887 const { notes, refusal } = await gateVerdict();
854888 // Said, never refused: a comment's width stops no check (#12968), nor does the look rule
855889 // (#13362).
src/kernel/test_honesty.ts added +97
@@ -0,0 +1,97 @@
1 /**
2 * Tests wait for a signal, not a clock (#14321): a ratchet on the fixed real-time waits in
3 * `test/`. Each test file's count of fixed numeric waits, `mock.module(` calls and test
4 * `retry:` / raised `timeout:` options is held to its entry in `docs/test-honesty.json`; over
5 * fails, and under fails too until the allowance is lowered, so the list only shrinks. The idea
6 * is the `no-fixed-sleep` rule of interfere-inc/landmines (MIT), counted here without its
7 * Node and Oxlint so the forge keeps one gate.
8 *
9 * Plain text in, plain data out: `scripts/gate.ts` (`testHonestyRefusal`) reads the tree.
10 */
11
12 export const HONESTY_FILE = "docs/test-honesty.json";
13 export const HONESTY_WRITE_COMMAND = "FORGE_SLEEP_WRITE=1 bun scripts/gate.ts";
14 export const HONESTY_ADVICE = "await the operation or an event it emits instead of a fixed delay";
15
16 export type Kind = "sleep" | "timer" | "mock" | "retry";
17 export type Counts = Partial<Record<Kind, number>>;
18 export type Allowance = Record<string, Counts>;
19
20 const KINDS: readonly Kind[] = ["sleep", "timer", "mock", "retry"];
21
22 const PATTERNS: Record<Kind, RegExp> = {
23 // `await Bun.sleep(50)`: a fixed wait; `Bun.sleep(ms)` with a name is not counted.
24 sleep: /await\s+Bun\.sleep\(\s*\d[\d_]*\s*\)/g,
25 // `setTimeout(resolve, 50)`: the same wait spelled by hand.
26 timer: /setTimeout\(\s*[A-Za-z_$][\w$]*\s*,\s*\d[\d_]*\s*\)/g,
27 mock: /\bmock\.module\(/g,
28 // A test's `retry: 2` or raised `timeout: 30_000`, on its own line or as `}, { retry: 2 }`.
29 retry: /(?:^[ \t]*|\}\s*,\s*\{\s*)(?:retry|timeout)\s*:\s*\d/gm,
30 };
31
32 const WORDS: Record<Kind, string> = {
33 sleep: "fixed `await Bun.sleep(<number>)`",
34 timer: "fixed `setTimeout(resolve, <number>)`",
35 mock: "`mock.module(`",
36 retry: "test `retry:` / `timeout:`",
37 };
38
39 /** What one test file's source holds of each kind; kinds it holds none of are left out. */
40 export function countHonesty(source: string): Counts {
41 const out: Counts = {};
42 for (const kind of KINDS) {
43 const n = source.match(PATTERNS[kind])?.length ?? 0;
44 if (n > 0) out[kind] = n;
45 }
46 return out;
47 }
48
49 /** The allowance for `sources` (path to text) as it is now: what `FORGE_SLEEP_WRITE=1` writes. */
50 export function measureHonesty(sources: Record<string, string>): Allowance {
51 const out: Allowance = {};
52 for (const path of Object.keys(sources).sort()) {
53 const counts = countHonesty(sources[path]!);
54 if (Object.keys(counts).length > 0) out[path] = counts;
55 }
56 return out;
57 }
58
59 /** The allowance file's text, validated: anything not path to counts of known kinds is refused. */
60 export function parseAllowance(text: string): Allowance | string {
61 let raw: unknown;
62 try {
63 raw = JSON.parse(text);
64 } catch {
65 return `${HONESTY_FILE} is not JSON; rewrite it with \`${HONESTY_WRITE_COMMAND}\``;
66 }
67 if (!raw || typeof raw !== "object" || Array.isArray(raw)) return `${HONESTY_FILE} is not an object of files`;
68 const out: Allowance = {};
69 for (const [path, counts] of Object.entries(raw as Record<string, unknown>)) {
70 if (!counts || typeof counts !== "object" || Array.isArray(counts)) return `${HONESTY_FILE}: ${path} is not an object of counts`;
71 const kept: Counts = {};
72 for (const [kind, n] of Object.entries(counts as Record<string, unknown>)) {
73 if (!(KINDS as readonly string[]).includes(kind)) return `${HONESTY_FILE}: ${path} names an unknown kind ${kind}`;
74 if (typeof n !== "number" || !Number.isInteger(n) || n < 0) return `${HONESTY_FILE}: ${path} ${kind} is not a whole count`;
75 kept[kind as Kind] = n;
76 }
77 out[path] = kept;
78 }
79 return out;
80 }
81
82 /** Each file and kind whose count differs from its allowance, worded as the gate says it. */
83 export function honestyProblems(measured: Allowance, allowed: Allowance): string[] {
84 const out: string[] = [];
85 const paths = [...new Set([...Object.keys(measured), ...Object.keys(allowed)])].sort();
86 for (const path of paths) {
87 for (const kind of KINDS) {
88 const has = measured[path]?.[kind] ?? 0;
89 const may = allowed[path]?.[kind] ?? 0;
90 if (has > may)
91 out.push(`${path}: ${has} ${WORDS[kind]}, ${has - may} over its allowance of ${may}; ${HONESTY_ADVICE}`);
92 else if (has < may)
93 out.push(`${path}: ${has} ${WORDS[kind]}, under its allowance of ${may}; lower it in ${HONESTY_FILE} with \`${HONESTY_WRITE_COMMAND}\` so the list only shrinks`);
94 }
95 }
96 return out;
97 }
test/test-honesty.test.ts added +70
@@ -0,0 +1,70 @@
1 // Tests wait for a signal, not a clock (#14321): the gate's ratchet on fixed waits in test/.
2 // @tree-scan: the last test asks the gate about this repository's own tree.
3 import { expect, test } from "bun:test";
4 import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
5 import { tmpdir } from "node:os";
6 import { join } from "node:path";
7 import { testHonestyRefusal, writeTestHonesty } from "../scripts/gate.ts";
8 import { countHonesty, HONESTY_ADVICE, parseAllowance } from "../src/kernel/test_honesty.ts";
9
10 // Spelled in pieces so this file's own counts stay zero.
11 const SLEEP = "await Bun." + "sleep(50);";
12
13 function tree(files: Record<string, string>): string {
14 const dir = mkdtempSync(join(tmpdir(), "forge-test-honesty-"));
15 for (const [f, text] of Object.entries(files)) {
16 mkdirSync(join(dir, f, ".."), { recursive: true });
17 writeFileSync(join(dir, f), text);
18 }
19 return dir;
20 }
21
22 test("each kind is counted; a named or computed wait is not", () => {
23 const source = [
24 SLEEP,
25 "await Bun." + "sleep(1_000);",
26 "await Bun.sleep(ms);",
27 "await new Promise((r) => set" + "Timeout(r, 20));",
28 "set" + "Timeout(() => done(), 20);",
29 "mock" + ".module(\"x\", () => ({}));",
30 "}, { re" + "try: 2 });",
31 " time" + "out: 30_000,",
32 ].join("\n");
33 expect(countHonesty(source)).toEqual({ sleep: 2, timer: 1, mock: 1, retry: 2 });
34 expect(countHonesty("const x = 1;")).toEqual({});
35 });
36
37 test("one new fixed sleep fails the gate with the advice; lowering is asked for too", () => {
38 const dir = tree({ "test/a.test.ts": SLEEP, "docs/test-honesty.json": "{}" });
39 try {
40 writeTestHonesty(dir);
41 expect(testHonestyRefusal(dir)).toEqual([]);
42 writeFileSync(join(dir, "test/a.test.ts"), `${SLEEP}\n${SLEEP}`);
43 expect(testHonestyRefusal(dir)).toEqual([
44 `test/a.test.ts: 2 fixed \`await Bun.sleep(<number>)\`, 1 over its allowance of 1; ${HONESTY_ADVICE}`,
45 ]);
46 writeFileSync(join(dir, "test/a.test.ts"), "");
47 expect(testHonestyRefusal(dir)[0]).toContain("under its allowance of 1; lower it in docs/test-honesty.json");
48 writeTestHonesty(dir);
49 expect(JSON.parse(readFileSync(join(dir, "docs/test-honesty.json"), "utf8"))).toEqual({});
50 expect(testHonestyRefusal(dir)).toEqual([]);
51 } finally {
52 rmSync(dir, { recursive: true, force: true });
53 }
54 });
55
56 test("a tree without the allowance has no ratchet; a malformed one is refused", () => {
57 const bare = tree({ "test/a.test.ts": SLEEP });
58 try {
59 expect(testHonestyRefusal(bare)).toEqual([]);
60 } finally {
61 rmSync(bare, { recursive: true, force: true });
62 }
63 expect(parseAllowance("[")).toContain("not JSON");
64 expect(parseAllowance('{"test/a.ts": {"naps": 1}}')).toContain("unknown kind naps");
65 expect(parseAllowance('{"test/a.ts": {"sleep": -1}}')).toContain("not a whole count");
66 });
67
68 test("this repository's allowance matches its tests today", () => {
69 expect(testHonestyRefusal(join(import.meta.dir, ".."))).toEqual([]);
70 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs