Commit a042aa4
committed
test(validator): assert the transport code positively, and state its reach
Adds the positive Unavailable assertion suggested in review: the negative alone
would pass for any other verdict, including classification being lost entirely.
Controlling it turned up something worth writing down rather than assuming. The
assertion does not catch what the suggestion said it would. errors.Is walks the
chain and Wrap keeps its Cause, so it matches when Unavailable is anywhere in the
chain — replacing PropagateOrWrap with a plain Wrap to Internal still passes it.
It pins the classification being dropped, not the outermost code being flattened
while the inner error survives.
Kept anyway: that is the same reach as the sibling
TestEnsureTrainerInstalled_PreservesProbeErrorCode and the convention in this
file, and dropped classification is the failure that actually matters here.
Pinning the outermost code would need a type assertion rather than errors.Is,
which is a change to the file's convention rather than to this test.
The comment now says what the assertion pins instead of what it was hoped to.
Refs #2297
Signed-off-by: Yuan Chen <yuanchen97@gmail.com>1 parent a459df6 commit a042aa4
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
510 | 523 | | |
0 commit comments