Skip to content

Give OkHttp the application context before the Android suites run - #37

Merged
yschimke merged 1 commit into
mainfrom
claude/ech-conscrypt-build-oncco9
Aug 14, 2026
Merged

Give OkHttp the application context before the Android suites run#37
yschimke merged 1 commit into
mainfrom
claude/ech-conscrypt-build-oncco9

Conversation

@yschimke

Copy link
Copy Markdown
Owner

main is red on android-ech, and the run that turned it red is the first useful one this suite has produced.

The retry worked

On e0c7c1d the install raced as before, and this time the retry from #35 caught it:

Starting 0 tests on emulator-5554
PublicEncryptedClientHelloTest produced no results; retrying once.
Starting 6 tests on emulator-5554

Six cases executed — the first time that has ever happened.

All six failed for a reason that isn't ECH

java.lang.IllegalStateException: Unable to load PublicSuffixDatabase.list resource.
Caused by: java.io.IOException: Platform applicationContext not initialized.
    Startup Initializer possibly disabled, call OkHttp.initialize before test.

#33's diagnosis was wrong in mechanism. The asset genuinely was missing and adding okhttp-android did ship it — but the list is read through a Context that nothing here supplied. DnsOverHttps asks isPrivateHost about the name before opening a connection, so all six died upstream of any TLS handshake. The runs said nothing about ECH either way.

Worth noting: okhttp3.internal.platform.PlatformInitializer is declared in the merged androidTest manifest through androidx Startup, and it still didn't run. Rather than work out why an initializer inside an instrumentation APK stays dormant, this sets the context outright in the runner, where it covers every suite including ones added later and happens once rather than per test.

Verification

What can be checked without an emulator, checked:

  • :android-ech:assembleDebugAndroidTest succeeds.
  • The merged manifest names the new runner: <instrumentation android:name="okhttp.testbed.android.ech.EchTestRunner" — a wrong runner name here is what would produce another zero-test run.

Still open, and not addressed here

The gating fixture suite failed separately on the same run: EncryptedClientHelloTest.rejectedConfigIsRetriedWithServerConfig FAILED, and the instrumentation process crashed with 2 of 3 completed. That suite passed 3/3 on earlier runs, and the log carries no assertion detail because the process died. It is a different failure from the one fixed here, I don't yet know its cause, and this PR does not claim to fix it. It is the thing keeping android-ech red.

This change removes the failure standing in front of ECH. What the six cases then say about API 37 is the result this repo has never had.


Generated by Claude Code

The six public ECH cases executed for the first time on e0c7c1d, and all six
failed the same way:

    java.lang.IllegalStateException: Unable to load PublicSuffixDatabase.list
    Caused by: java.io.IOException: Platform applicationContext not initialized.
        Startup Initializer possibly disabled, call OkHttp.initialize before test.

So #33's diagnosis was wrong in mechanism. The asset was missing and adding
`okhttp-android` did ship it, but that was only half: the list is read through
a `Context` that nothing here ever supplied. `DnsOverHttps` asks `isPrivateHost`
about the name before opening anything, so all six died there, upstream of any
TLS — the runs said nothing about ECH.

`okhttp3.internal.platform.PlatformInitializer` is declared in the merged
androidTest manifest via androidx Startup, and it still didn't run. Rather than
work out why an initializer inside an instrumentation APK stays dormant, set
the context outright, in the runner, where it covers every suite and happens
once.

Verified as far as it can be without an emulator: the APK assembles and the
merged manifest names the new runner —

    <instrumentation android:name="okhttp.testbed.android.ech.EchTestRunner"

Not claimed: that this makes the public suite pass. It removes the failure
that stood in front of ECH; what those six cases then say about API 37 is the
result we have never had.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CqiK79k9uoWsn2AzgXpHMA
@yschimke
yschimke merged commit 5f193b0 into main Aug 14, 2026
2 checks passed
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