fix(python): always use fake token in E2E tests to prevent hang #457
+11
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When running Python E2E tests locally (outside CI), they hang indefinitely on any test that sends a message via
send_and_wait().Root Cause
The E2E test harness overrides
XDG_CONFIG_HOMEto an isolated temp directory for test isolation. When not in CI,github_tokenwasNone, so the CLI defaulted touse_logged_in_user=True— but found no credentials in the empty temp dir.The CLI logged
Error: Session was not created with authentication info or custom providerbut never emitted asession.errorevent back to the SDK, sosend_and_wait()blocked forever waiting for asession.idlethat would never come.Fix
Always pass
github_token="fake-token-for-e2e-tests"in the test harness and in the one test that creates its own client. Since E2E tests use a replaying proxy with canned responses, real auth is never needed.Verification
All 74 Python E2E tests pass (2 pre-existing skips for known unrelated issues).