fix: CI test failures on Windows and E2E (#1165)

- Windows: match "actively refused it" error message in
  download_bytes_connection_refused test (os error 10061)
- E2E relaunch: use userAgent instead of extensions to trigger
  relaunch, since extensions force headed mode which requires a
  display server unavailable in CI
- E2E auth_login SPA: use addEventListener instead of inline
  onsubmit for more reliable form submission prevention
This commit is contained in:
Chris Tate
2026-04-06 09:42:30 -05:00
committed by GitHub
parent 131f229971
commit c3bbb15c5f
2 changed files with 13 additions and 4 deletions
+3 -1
View File
@@ -1029,7 +1029,9 @@ mod tests {
// The new code should include the root cause (connection refused)
// not just the vague "error sending request for url"
assert!(
err.contains("Connection refused") || err.contains("connection refused"),
err.contains("Connection refused")
|| err.contains("connection refused")
|| err.contains("actively refused it"),
"expected 'connection refused' in error, got: {}",
err
);
+10 -3
View File
@@ -3063,12 +3063,17 @@ async fn start_delayed_login_server(
setTimeout(() => {{
const root = document.getElementById('root');
root.innerHTML = `
<form id="login-form" onsubmit="event.preventDefault(); window.__submitted = true;">
<form id="login-form">
<input type="email" name="email" />
<input type="password" name="password" />
<button type="submit">Sign in</button>
</form>
`;
document.getElementById('login-form').addEventListener('submit', function(e) {{
e.preventDefault();
e.stopPropagation();
window.__submitted = true;
}});
}}, {render_delay_ms});
</script>
</body>
@@ -3865,13 +3870,15 @@ async fn e2e_relaunch_on_options_change() {
"identical options must reuse the browser"
);
// Third launch — different options (extensions added) → must relaunch, not reuse.
// Third launch — different options (userAgent changed) → must relaunch, not reuse.
// We use userAgent instead of extensions because extensions force headed mode,
// which requires a display server and fails in headless CI environments.
let resp = execute_command(
&json!({
"id": "3",
"action": "launch",
"headless": true,
"extensions": ["/tmp/fake-extension"]
"userAgent": "agent-browser-test/1.0"
}),
&mut state,
)