From 1083a0a4cf05986a9649b36c814219586eafe8eb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 20:15:47 +0000 Subject: [PATCH 1/3] Run the Dart integration suites without flutter test's -v Both Dart steps ran flutter test verbose, marked DEBUG, to see what it waited on when it launched the app and never connected. iOS's cause was a flutter_tools race, now patched in the workflow; the Android hang hasn't recurred, and logcat is still recorded as an artifact. Verbose output put the whole Xcode/Gradle build and the app's Info.plist in every job log, burying the test results. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BqmpXW1H7XRFuEgBWW3ppW --- .github/workflows/ci.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8f205dd..96b4d7e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -209,9 +209,7 @@ jobs: FLUTTER: flutter SUITES: dart QLOGDIR: ${{ runner.temp }}/qlog/dart - # DEBUG -v: flutter test once launched the app and then waited 13 minutes without connecting to it; verbose - # output shows what it waits on. - run: ./run_integration_tests.sh ios "${{ steps.simulator.outputs.udid }}" -v + run: ./run_integration_tests.sh ios "${{ steps.simulator.outputs.udid }}" - name: Upload logs if: always() timeout-minutes: 2 @@ -354,8 +352,7 @@ jobs: env: FLUTTER: flutter SUITES: dart - # DEBUG -v: shows what flutter test waits on when it doesn't connect to the app (see Record logcat). - run: ./run_integration_tests.sh android emulator-5554 -v + run: ./run_integration_tests.sh android emulator-5554 # Runs after a failed Dart suite too, but not when the emulator never came up. - name: Native bridge tests (instrumented) if: ${{ !cancelled() && steps.emulator.outcome == 'success' }} From a0e1f5a3abb38a62f50e8c63740ba5823abd60b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 20:18:45 +0000 Subject: [PATCH 2/3] Retry the Dart suite's warm-up call up to three times In run 42689216883 on main the single warm-up call timed out after 10 s and failed setUpAll, so none of the cases ran. trustd had stalled every certificate check: at 20:12:13 it began updating its pinning database (version 118 to 131, from a PKITrustSupplementals trust data update it downloaded on the freshly booted simulator), and its other evaluations then retried a locked SQLite database for the rest of the run. setUpAll now makes up to three 8 s attempts, each on a fresh client whose call a deadline cancels, and logs each outcome. That rides out a shorter stall; it would not have saved that run, where the lock outlasted the suite. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BqmpXW1H7XRFuEgBWW3ppW --- example/integration_test/eliza_test.dart | 31 ++++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/example/integration_test/eliza_test.dart b/example/integration_test/eliza_test.dart index 1a581bd..c41cadc 100644 --- a/example/integration_test/eliza_test.dart +++ b/example/integration_test/eliza_test.dart @@ -141,19 +141,34 @@ void main() { // on the same CI runner are both slow (a QUIC connection took 66 ms to set up, and the server answered its first // packet 130 ms after it was sent), so the first call's QUIC attempt loses URLSession's race to TCP. The cases then // start on a warm app and server. The protocol it got is logged, not checked. + // + // A few attempts, each on a fresh client whose call a deadline cancels: on a freshly booted simulator, trustd can + // stall every certificate check for a while (once while it updated its pinning database from a trust data update). + // Three 8 s attempts stay inside the test framework's 30 s default timeout. setUpAll(() async { if (serverUrl.isEmpty) { return; // setUp reports it. } - final warmup = await Harness.create(serverUrl, http3Origins: {Uri.parse(serverUrl)}); - try { - await warmup.eliza - .say(SayRequest(sentence: 'warm up'), onHeader: warmup.recordHeaders) - .timeout(const Duration(seconds: 10)); - debugPrint('warm-up call went over ${warmup.serverProtocols.single}'); - } finally { - await warmup.native.close(); + const attempts = 3; + final errors = []; + for (var attempt = 1; attempt <= attempts; attempt++) { + final warmup = await Harness.create(serverUrl, http3Origins: {Uri.parse(serverUrl)}); + try { + await warmup.eliza.say( + SayRequest(sentence: 'warm up'), + signal: TimeoutSignal(const Duration(seconds: 8)), + onHeader: warmup.recordHeaders, + ); + debugPrint('warm-up call $attempt went over ${warmup.serverProtocols.single}'); + return; + } on ConnectException catch (e) { + debugPrint('warm-up call $attempt failed: $e'); + errors.add(e); + } finally { + await warmup.native.close(); + } } + fail('no warm-up call succeeded in $attempts attempts: $errors'); }); setUp(() async { From 85f6679f6da38f1a0132adc84d1441e4c6d494eb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 20:26:36 +0000 Subject: [PATCH 3/3] Give CronetBridgeTest's waits 10 s instead of 3 s In run 42691768445 writesBeforeTheStreamIsReadyAreSentOnceItIs failed with no events for its call after 3 s. The server received the call's request about 3 s after it was opened, just as the wait gave up: each case builds a fresh Cronet engine and so a fresh TCP+TLS connection to the host through the emulator, and this one took that long to come up. DNS was answered from cache in 3 ms and the test process was idle meanwhile. 3 s matches two lost-SYN retransmissions (1 s + 2 s), though the logs can't confirm the packet loss. 10 s, as the Dart cases allow, still fails a real hang quickly. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BqmpXW1H7XRFuEgBWW3ppW --- .../com/agtonomy/connect_native_http/CronetBridgeTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/androidTest/kotlin/com/agtonomy/connect_native_http/CronetBridgeTest.kt b/android/src/androidTest/kotlin/com/agtonomy/connect_native_http/CronetBridgeTest.kt index d7a6d3d..8aba6e4 100644 --- a/android/src/androidTest/kotlin/com/agtonomy/connect_native_http/CronetBridgeTest.kt +++ b/android/src/androidTest/kotlin/com/agtonomy/connect_native_http/CronetBridgeTest.kt @@ -89,8 +89,10 @@ class CronetBridgeTest { )) } + // Each case opens a fresh connection to the host through the emulator, which once took 3 s to come up on CI (the + // request reached the server just as a 3 s wait gave up). 10 s, like the Dart cases, still fails a real hang fast. private fun await(callId: Int, vararg types: String): Map { - val deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(3) + val deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(10) while (true) { events.firstOrNull { it["callId"] == callId && it["type"] in types }?.let { return it } val left = deadline - System.nanoTime()