Commit d042ea9
Queue::fake the seven V2 timer-wait cancel/terminate tests + respect available_at in drainReadyTasks
Same bucket A root cause as the signal-command fix: cancel/terminate
tests that wait for a workflow to park on a timer were racing the
real testbench queue workers. Under CI load the first waitFor could
outrun the worker even with the 30s budget.
Converting to Queue::fake + drainReadyTasks wasn't enough on its own
because drainReadyTasks in V2WorkflowTest didn't consult `available_at`
— a timer task scheduled for +2s was created with status=Ready, so
the drain loop fired the timer immediately and the workflow completed
before the test could cancel. Fix the drain filter so it matches the
real worker's semantics: only run tasks whose `available_at` is null
or already in the past.
With the drain respecting `available_at`, these seven tests can now
use the same Queue::fake + drainReadyTasks pattern as every other
reliable test in the file:
* testWorkflowCanBeCancelledWhileWaitingOnTimer
* testWorkflowCanBeTerminatedWhileWaitingOnTimer
* testCancelWithoutReasonLeavesReasonNull
* testCancelCreatesFailureRowWithCancelledCategory
* testTerminateCreatesFailureRowWithTerminatedCategory
* testCancelWithoutReasonCreatesFailureRowWithDefaultMessage
* testCancelFailureRowAppearsInFailureSnapshots
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a349bbe commit d042ea9
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6561 | 6561 | | |
6562 | 6562 | | |
6563 | 6563 | | |
| 6564 | + | |
| 6565 | + | |
6564 | 6566 | | |
6565 | 6567 | | |
6566 | 6568 | | |
6567 | 6569 | | |
6568 | 6570 | | |
6569 | 6571 | | |
6570 | 6572 | | |
| 6573 | + | |
| 6574 | + | |
6571 | 6575 | | |
6572 | 6576 | | |
6573 | 6577 | | |
| |||
6680 | 6684 | | |
6681 | 6685 | | |
6682 | 6686 | | |
| 6687 | + | |
| 6688 | + | |
6683 | 6689 | | |
6684 | 6690 | | |
6685 | 6691 | | |
6686 | 6692 | | |
6687 | 6693 | | |
6688 | 6694 | | |
6689 | 6695 | | |
| 6696 | + | |
| 6697 | + | |
6690 | 6698 | | |
6691 | 6699 | | |
6692 | 6700 | | |
| |||
7803 | 7811 | | |
7804 | 7812 | | |
7805 | 7813 | | |
| 7814 | + | |
| 7815 | + | |
7806 | 7816 | | |
7807 | 7817 | | |
7808 | 7818 | | |
7809 | 7819 | | |
7810 | 7820 | | |
7811 | 7821 | | |
7812 | 7822 | | |
| 7823 | + | |
| 7824 | + | |
7813 | 7825 | | |
7814 | 7826 | | |
7815 | 7827 | | |
| |||
7833 | 7845 | | |
7834 | 7846 | | |
7835 | 7847 | | |
| 7848 | + | |
| 7849 | + | |
7836 | 7850 | | |
7837 | 7851 | | |
7838 | 7852 | | |
7839 | 7853 | | |
7840 | 7854 | | |
7841 | 7855 | | |
7842 | 7856 | | |
| 7857 | + | |
| 7858 | + | |
7843 | 7859 | | |
7844 | 7860 | | |
7845 | 7861 | | |
| |||
7883 | 7899 | | |
7884 | 7900 | | |
7885 | 7901 | | |
| 7902 | + | |
| 7903 | + | |
7886 | 7904 | | |
7887 | 7905 | | |
7888 | 7906 | | |
7889 | 7907 | | |
7890 | 7908 | | |
7891 | 7909 | | |
7892 | 7910 | | |
| 7911 | + | |
| 7912 | + | |
7893 | 7913 | | |
7894 | 7914 | | |
7895 | 7915 | | |
| |||
7933 | 7953 | | |
7934 | 7954 | | |
7935 | 7955 | | |
| 7956 | + | |
| 7957 | + | |
7936 | 7958 | | |
7937 | 7959 | | |
7938 | 7960 | | |
7939 | 7961 | | |
7940 | 7962 | | |
7941 | 7963 | | |
7942 | 7964 | | |
| 7965 | + | |
| 7966 | + | |
7943 | 7967 | | |
7944 | 7968 | | |
7945 | 7969 | | |
| |||
7957 | 7981 | | |
7958 | 7982 | | |
7959 | 7983 | | |
| 7984 | + | |
| 7985 | + | |
7960 | 7986 | | |
7961 | 7987 | | |
7962 | 7988 | | |
7963 | 7989 | | |
7964 | 7990 | | |
7965 | 7991 | | |
7966 | 7992 | | |
| 7993 | + | |
| 7994 | + | |
7967 | 7995 | | |
7968 | 7996 | | |
7969 | 7997 | | |
| |||
8014 | 8042 | | |
8015 | 8043 | | |
8016 | 8044 | | |
| 8045 | + | |
| 8046 | + | |
| 8047 | + | |
| 8048 | + | |
8017 | 8049 | | |
8018 | 8050 | | |
8019 | 8051 | | |
| |||
0 commit comments