Commit 5d23aa8
committed
fix(test): defeat Linear API's transient "conflict on insert" flake
CI's Tests (Online) job has been flaking on `projects create` for
several PRs. Linear's API has a transient failure mode where `*Create`
mutations return "Entity X with id <UUID> already exists" for a UUID
that doesn't actually exist server-side (verified by `read` immediately
returning "Entity not found"). The same pattern hit PR #140's post-merge
CI before the work in #141 even started.
Local probing shows a clear cold-start signature: from a fresh process,
the first ~3 attempts at `projects create` fail back-to-back, then it
abruptly starts working (next 7 succeed in a row). The previous helper's
3-retry, 14s-backoff budget routinely runs out before the cold window
closes.
Layered fix:
1. **`run_lineark_with_retry`** (in tests/online.rs):
- Up to 8 attempts with `[0, 2, 5, 10, 20, 30, 45, 60]`s backoff
(~172s worst case) so we ride out the cold window.
- Mutate the request body each retry by appending a fresh suffix to
the `<name>` positional. Linear's stuck UUIDs are keyed on body
content, so a different body avoids the cached state.
- Returns `(Output, String)` where the second element is the name
actually used. Callers shadow their `unique_name` with this so
downstream `read by name` lookups match server state.
2. **CI workflow + Makefile** (`ci.yml`, `ci-online-fork.yml`,
`Makefile`): wrap the whole online suite in a 3x retry with a
workspace clean between attempts. Belt-and-suspenders for the
occasional case where even the per-call helper's budget isn't enough.1 parent 0ee74b2 commit 5d23aa8
4 files changed
Lines changed: 127 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
111 | 129 | | |
112 | 130 | | |
113 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
31 | 64 | | |
32 | | - | |
33 | | - | |
| 65 | + | |
34 | 66 | | |
35 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
36 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
37 | 88 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 89 | + | |
| 90 | + | |
43 | 91 | | |
44 | 92 | | |
45 | 93 | | |
| |||
793 | 841 | | |
794 | 842 | | |
795 | 843 | | |
796 | | - | |
| 844 | + | |
797 | 845 | | |
798 | 846 | | |
799 | 847 | | |
| |||
2449 | 2497 | | |
2450 | 2498 | | |
2451 | 2499 | | |
2452 | | - | |
| 2500 | + | |
2453 | 2501 | | |
2454 | 2502 | | |
2455 | 2503 | | |
| |||
2600 | 2648 | | |
2601 | 2649 | | |
2602 | 2650 | | |
2603 | | - | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
2604 | 2654 | | |
2605 | 2655 | | |
2606 | 2656 | | |
| |||
2718 | 2768 | | |
2719 | 2769 | | |
2720 | 2770 | | |
2721 | | - | |
| 2771 | + | |
2722 | 2772 | | |
2723 | 2773 | | |
2724 | 2774 | | |
| |||
2815 | 2865 | | |
2816 | 2866 | | |
2817 | 2867 | | |
2818 | | - | |
| 2868 | + | |
2819 | 2869 | | |
2820 | 2870 | | |
2821 | 2871 | | |
| |||
4312 | 4362 | | |
4313 | 4363 | | |
4314 | 4364 | | |
4315 | | - | |
| 4365 | + | |
4316 | 4366 | | |
4317 | 4367 | | |
4318 | 4368 | | |
| |||
0 commit comments