Skip to content

Skip the SSO E2E tests when Tsinghua's sites hang mid-load, and say why they didn't answer - #1806

Merged
robertying merged 2 commits into
mainfrom
claude/project-thread-krswj4
Nov 23, 2026
Merged

robertying merged 2 commits into
mainfrom
claude/project-thread-krswj4

Conversation

@robertying

@robertying robertying commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Requested by Rui · project thread

Summary

Changes to the @network tests in electron/e2e/sso.e2e.ts:

  • The check before each test says why it skipped. It now gives the site and the HEAD request's error code: the cause.code from Node's fetch (ECONNRESET, UND_ERR_CONNECT_TIMEOUT, ENOTFOUND, …), or the error's name (TimeoutError). Before, it said only "doesn't answer from here". The check now also covers learn.tsinghua.edu.cn, where the web view starts (SSO_LOGIN_URL), as well as id.tsinghua.edu.cn, where it lands. Any HTTP answer still counts as reachable.
  • A load that hangs counts as the site not answering. On Windows, some runs had the web view still loading Tsinghua's page after 30 s, with no load error (Received: null). The tests now keep track of the web view's main-frame navigations and its dom-ready event. If it is still loading a Tsinghua page when the wait ends, the test skips, the same way the check before the test does.
  • Network load failures count on any Tsinghua site, not only id.tsinghua.edu.cn. They are also checked again after the wait, in case one lands right as it ends.

Any other outcome still fails the test: a page that loaded but isn't the login page, a load that never started, a load outside Tsinghua, or an error that isn't from the network.

Testing

Run locally, forcing the tests past the check before the test:

  • Hang: an HTTPS proxy that accepts connections and never answers. 12 of 12 attempts skipped with "…/login/form/…: still loading after 30 s". The version before the recheck failed 1 of 8, with a load error that landed as the wait ended.
  • Refused connection: the two navigating tests skip with ERR_TUNNEL_CONNECTION_FAILED (-111). The cancel test passes.
  • Normal run with the site unreachable: "Doesn't answer from here: https://learn.tsinghua.edu.cn/: ENOTFOUND".
  • tsc -p electron, oxlint and oxfmt pass.

🤖 Generated with Claude Code

The check before each @network SSO test skipped with only "doesn't answer from here". It now adds the request's error code (ECONNRESET, UND_ERR_CONNECT_TIMEOUT, TimeoutError, ENOTFOUND...), so the reports tell a connection the site cut from one that timed out or a name that didn't resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… both sites first

Windows runs also failed with the web view still loading Tsinghua's login page after 30 s, with no load error (location.hostname null). The tests now keep the web view's main frame navigations and dom-ready, and skip when it is still loading a Tsinghua page when the wait ends. A network load failure now counts on any Tsinghua site, not only id.tsinghua.edu.cn, and is checked again after the wait, in case it lands just then.

The check before each test now also asks learn.tsinghua.edu.cn, where the web view starts, besides id.tsinghua.edu.cn, and names the site that didn't answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertying robertying changed the title Say why Tsinghua's login site didn't answer when the SSO E2E tests skip Skip the SSO E2E tests when Tsinghua's sites hang mid-load, and say why they didn't answer Nov 23, 2026
@robertying
robertying merged commit de76eb1 into main Nov 23, 2026
9 checks passed
@robertying
robertying deleted the claude/project-thread-krswj4 branch November 23, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants