Skip to content

Commit e112671

Browse files
itdoveclaude
andcommitted
fix(test): update test to expect error for unsolicited 101 upgrade
The test `relay_rejects_unsolicited_101_without_client_upgrade_header` was updated to expect an error instead of Ok(Consumed) after the code change that made unsolicited 101 upgrades return an Err. The behavior change was correct (unsolicited upgrades should fail), but the test assertion wasn't updated to match the new error-returning behavior. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a91fb49 commit e112671

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • crates/openshell-sandbox/src/l7

crates/openshell-sandbox/src/l7/rest.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,10 +1735,15 @@ mod tests {
17351735
.await
17361736
.expect("relay must not deadlock");
17371737

1738-
let outcome = result.expect("relay should succeed");
1738+
// Unsolicited 101 upgrade should return an error
17391739
assert!(
1740-
matches!(outcome, RelayOutcome::Consumed),
1741-
"unsolicited 101 should be rejected as Consumed, got {outcome:?}"
1740+
result.is_err(),
1741+
"unsolicited 101 should be rejected with an error"
1742+
);
1743+
let err_msg = result.unwrap_err().to_string();
1744+
assert!(
1745+
err_msg.contains("unsolicited 101"),
1746+
"error message should mention unsolicited 101, got: {err_msg}"
17421747
);
17431748

17441749
upstream_task.await.expect("upstream task should complete");

0 commit comments

Comments
 (0)