Skip to content

Commit 6279f8f

Browse files
committed
test(rust): drop the raw-hyper_util duplicate of the 2xx-not-200 tripwire
hyper_util_still_refuses_a_2xx_that_is_not_200 (tests/upstream_tunnel.rs) called Tunnel directly, with none of this crate's own code involved, to pin the same known defect known_issue_a_success_other_than_200_does_not_open_the_tunnel (tests/proxy.rs) already pins through the full stack - config, connect, ProxyConnector, translate(). Both go red the day hyper-util fixes it; the proxy.rs one is strictly more informative, since it also proves this crate's own error translation still reacts correctly. Kept that one, dropped the raw duplicate. The other two tests in upstream_tunnel.rs stay: the control, and the split-status-line case, which has no equivalent in tests/proxy.rs. Updated the file's module doc and the remaining test's panic message, which both referenced the removed test. Corrected the README's "Known issues" intro, which claimed every pinning test is named known_issue_*: the upstream_tunnel.rs ones never were.
1 parent f09d99d commit 6279f8f

2 files changed

Lines changed: 7 additions & 28 deletions

File tree

packages/rust/armonik-transport/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ out in the clear, the proxy's own URL has to be `http`. The tunnel handshake its
2222
### Known issues
2323

2424
`Tunnel`, as shipped in `hyper-util` 0.1.20, gets four cases wrong. None are ours to fix directly, and
25-
each is pinned by a test named `known_issue_*`, in `tests/proxy.rs` or `tests/upstream_tunnel.rs`, so a
26-
`hyper-util` release that fixes one turns that test red rather than letting the fix pass unnoticed.
25+
each is pinned by a test - named `known_issue_*` in `tests/proxy.rs`, or named for what it exercises in
26+
`tests/upstream_tunnel.rs` - so a `hyper-util` release that fixes one turns that test red rather than
27+
letting the fix pass unnoticed.
2728

2829
- **Only an exact `200` opens the tunnel.** RFC 9110 says any `2xx` should. A proxy answering `201` or
2930
`204` is treated as a refusal.

packages/rust/armonik-transport/tests/upstream_tunnel.rs

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! What `hyper_util`'s `Tunnel`, which [`crate::proxy`] drives, still gets wrong.
22
//!
3-
//! These tests assert that `Tunnel` gets two cases wrong. They are meant to fail: when a
4-
//! `hyper-util` release fixes either, the failure is the notice that the crate README's
5-
//! "Known issues" section, and the matching tripwire in `tests/proxy.rs`, are out of date.
6-
//! Fixing them upstream is tracked by #702.
3+
//! This asserts that `Tunnel` gets a split status line wrong. It is meant to fail: when a
4+
//! `hyper-util` release fixes it, the failure is the notice that the crate README's "Known issues"
5+
//! section is out of date. Fixing it upstream is tracked by #702.
76
//!
87
//! A dependency bump turning CI red is the point. Read the failure before assuming it is a regression.
98
@@ -94,26 +93,6 @@ async fn a_plain_200_opens_the_tunnel() {
9493
.expect("the fixture itself must let an ordinary 200 through");
9594
}
9695

97-
#[tokio::test]
98-
async fn hyper_util_still_refuses_a_2xx_that_is_not_200() {
99-
// RFC 9110: any 2xx switches a `CONNECT` connection to tunnel mode. `Tunnel` compares the status
100-
// line against `200` alone, so a proxy answering 201 is treated as a refusal.
101-
let proxy = spawn_proxy("HTTP/1.1 201 Connection established\r\n\r\n", None).await;
102-
103-
let error = tunnel_through(proxy).await.err().unwrap_or_else(|| {
104-
panic!(
105-
"hyper-util now opens the tunnel on a 2xx other than 200. \
106-
Check the split-status-line case too, and if that is fixed as well, drop this test, \
107-
the matching one in tests/proxy.rs, and the README's \"Known issues\" section."
108-
)
109-
});
110-
111-
assert!(
112-
error.contains("unsuccessful"),
113-
"unexpected failure: {error}"
114-
);
115-
}
116-
11796
#[tokio::test]
11897
async fn hyper_util_still_refuses_a_status_line_split_across_reads() {
11998
// Cut inside `HTTP/1.1 200`, so the first read carries `HTTP/1.1 2`, which matches neither prefix
@@ -125,8 +104,7 @@ async fn hyper_util_still_refuses_a_status_line_split_across_reads() {
125104
panic!(
126105
"hyper-util now reads a split status line correctly, or the two writes reached it as \
127106
one read. Rule the second out before believing the first: the halves are 50ms apart \
128-
on a socket with Nagle off. If it really is fixed, check the 2xx case too, and if that \
129-
is fixed as well, drop this test, the matching one in tests/proxy.rs, and the README's \
107+
on a socket with Nagle off. If it really is fixed, drop this test and the README's \
130108
\"Known issues\" section."
131109
)
132110
});

0 commit comments

Comments
 (0)