Commit 8bb4ba6
authored
test(web): mark three open server-function gaps as expected failures (#3112)
* test(web): mark three open server-function gaps as expected failures
Each is verified against `next` and stated as the behaviour that is
wanted, so the suite stays green while the gap is open and turns red the
day it closes.
- A result the codec cannot encode is delivered as `undefined`. The
function already ran; only the encoding failed, and it failed after the
head was committed, so the status is spent and no error tag can be
added. The truncated body decodes to the same answer a void function
gives, so a write that succeeded is indistinguishable from one that
returned nothing.
- A streamed result has no backpressure: the stream is built with no
`pull` and no queuing strategy, and every codec node is enqueued as
soon as it is parsed. A consumer reading three chunks over 60ms left
the producer 3695 items ahead; on a large or infinite stream one slow
client buffers the whole result in server memory.
- The decode depth cap guards the seroval path only, and the body format
is chosen by the caller, so selecting the JSON format opts out of it:
depth 5000 decodes where the capped path answers 400.
`.fails` rather than the repo's `test.skip` idiom because the point is to
notice the fix. Tests only; no runtime change, so no changeset.
* test(web): fix the depth gap's header, and make two assertions honest
Review of the first commit turned up three things, one of which made a
test worthless:
- BODY_FORMAT_HEADER is not exported from the server entry, so the import
was `undefined` and the request carried a header literally named
"undefined". The JSON format was never selected and the function
received no argument at all: the handler answered {"depth":0} where the
gap needs {"depth":500}. The test failed, but not for its own reason —
exactly the failure mode `.fails` cannot show you. Local const, as
`server-functions-failure-signal.spec.tsx` already does.
- Depth 5000 sat on the repo's own cliff (shared.ts notes ~5900 nested
objects overflow V8's default stack on CI). 500 is comfortably past the
64-level cap and nowhere near it.
- The backpressure ceiling was wall-clock, and under `.fails` a starved CI
that produced fewer than 500 would have turned red for no reason.
Counted in event-loop turns instead: bounded stays near the queue size
on any machine, unbounded tracks the turn count.
Also adopts MATRIX.md's spelling (`test.fails` with a `// GAP:` comment),
which is the repo's documented idiom for this and which the first commit
wrongly described as absent, and drops a dead assertion after
rejects.toThrow().
* test(web): point each gap marker at the issue tracking it
MATRIX.md's convention is a `// GAP:` comment; naming the issue in it
means whoever closes one finds the test that turns red.1 parent 21cf936 commit 8bb4ba6
1 file changed
Lines changed: 181 additions & 0 deletions
Lines changed: 181 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 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 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
0 commit comments