Skip to content

Keep the logcat, and say when the suite aborted instead of "2 tests failed" - #130

Merged
wanderdev0 merged 1 commit into
mainfrom
ci/keep-the-logcat
Aug 22, 2026
Merged

wanderdev0 merged 1 commit into
mainfrom
ci/keep-the-logcat

Conversation

@wanderdev0

Copy link
Copy Markdown
Owner

Diagnostics only. Neither change tries to fix the crash, because there is not yet evidence to
fix it with — see below.

What happened

A run on #129 died part-way through:

testEmulator Tests 362/543 completed. (5 skipped) (2 failed)
Finished 362 tests on testEmulator
Test run failed to complete. Instrumentation run failed due to Process crashed.

It was reported as two failing tests. The truth is that 181 tests never ran, and the two
names printed were whichever happened to be in flight when the process died — arbitrary, nothing
to do with the cause, and treated as clues for a while before the count was noticed.

A re-run of the same commit finished all 548. A full local run finished 548 with zero failures in
9m 7s. So it is intermittent and environmental, not something this or any recent PR does
deterministically.

Keep the logcat

The job already uploaded app/build/reports/androidTests/ — HTML summaries, which are useful for
reading an assertion and useless for a process that died. The logcat lives somewhere else
entirely, app/build/outputs/androidTest-results/, and was being discarded.

So a CI-only crash could be observed and never explained: Process crashed, and nothing further.
It costs nothing on a green run.

Say when the suite aborted

The last Tests N/M completed line carries both numbers. If N falls short of M the step fails
saying so, instead of leaving a reader to work out that a two-failure summary was really a suite
that stopped early.

Verified against the real logs from both runs of #129 — the aborted one (correctly fails: "only
362 of 543 tests ran") and the one that finished (correctly passes; note a re-run can report more
finished than expected, so the check is <, not !=).

Deliberately lenient where it cannot be sure: if no counts appear in the log it defers to Gradle
rather than inventing a verdict.

Not done, on purpose

Emulator memory, sharding, clearPackageData — all plausible, none evidence-based yet. The next
occurrence will now carry a logcat, and that is the point.


🤖 Written by Claude Code

…ailed"

A run on #129 died part-way: 362 of 543 tests, then "Instrumentation run
failed due to Process crashed". It was reported as two failing tests, and
those two names were whichever happened to be in flight - arbitrary, nothing
to do with the cause, and treated as clues for a while before the count was
noticed. The other 181 never ran, which the summary does not mention at all.

Two changes, both diagnostic. Neither tries to fix the crash: it did not
reproduce locally across a full 548-test run, and a change guessing at
emulator memory or sharding would be a fix with no evidence behind it.

**The logcat is kept.** The job already uploaded reports/androidTests/, which
is HTML summaries - useful for reading an assertion, useless for a process
that died. The logcat lives in outputs/androidTest-results/ and was being
discarded, so a CI-only crash could be seen and never explained. It costs
nothing on a green run.

**And the completed count is checked.** The last "Tests N/M completed" line
carries both numbers; if N is short of M the step fails saying so, rather
than leaving a reader to work out that a two-failure summary was really a
suite that stopped. Verified against the real logs from both runs of #129 -
the aborted one and the one that finished.

Note the check is deliberately lenient where it cannot be sure: no counts in
the log means it defers to Gradle rather than inventing a verdict.

Co-Authored-By: Claude Opus 5 <[email protected]>
@wanderdev0
wanderdev0 merged commit 3501f3b into main Aug 22, 2026
wanderdev0 added a commit that referenced this pull request Aug 22, 2026
CI aborted this branch's suite at 335 of 564 tests. The logcat artefact added
in #130 caught what nothing had caught before - a native crash, with a stack:

    AnisetteStatus.of -> LocalAnisette.ensureReady -> LocalAnisette.load
      -> AdiLibrary.initialise -> NativeAdi.callWithPath
      -> libstoreservicescore.so
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), tid RxCachedThreadS

MapsActivity asks for Anisette on the way to restoring a session, and the real
source dlopens Apple's library and initialises it. Correct in the app. In a
suite it happens once per test, in one process, on whichever Rx thread got
there first - and sometimes it segfaults. A native crash takes the whole
instrumentation with it, so the run does not fail, it *stops*, and every
remaining test is reported as never having run.

That is almost certainly the intermittent whole-suite abort this repo has been
living with. It has been showing up as two arbitrary test names and
`Process crashed`, which is why it never got diagnosed: the names are whatever
was in flight, and the cause was in a logcat nobody kept.

The login-flow tests have always replaced Anisette with a fake. The map fixture
never did, so every test built on it was loading the real thing - and nothing
built on it is testing Anisette. Now it does the same.

Found because a new test in this branch tripped it reliably enough to fail CI
rather than intermittently. Fixing the fixture rather than the test, because
the test was not doing anything unusual.

Co-Authored-By: Claude Opus 5 <[email protected]>
ubrt pushed a commit to ubrt/OpenTagViewer that referenced this pull request Aug 22, 2026
Three whole-suite aborts today, each naming different tests, each the same
native crash - and the logcat artefact from wanderdev0#130 is what finally identified it.

The trigger is ordinary: a session that cannot be restored. MapsActivity asks
for Anisette on one thread, the restore fails, the app sends the user to the
login screen, and that asks for Anisette on another - two real LocalAnisette
instances at once. `ensureReady()` is synchronized on the instance, so two
instances is no mutual exclusion at all, and the log shows both threads
unpacking the same .so files before dlopening them:

    2419  AdiLibraryFetcher: libstoreservicescore.so: 2.39 MB unpacked
    2570  AdiLibraryFetcher: libstoreservicescore.so: 2.39 MB unpacked

A native crash takes the instrumentation with it, so the run does not fail, it
stops - and the tests it names are whichever were in flight.

Faked in the four classes that drive an activity without the map fixture, which
already got this. Worth doing on its own terms even after the app is fixed:
these tests were *downloading* Apple's libraries during the suite - the log
says "downloaded 2.6 MB of 142 MB" - which is a network dependency nobody asked
for, in tests that are not about Anisette.

**This is a workaround, not the fix.** The app still re-initialises ADI on
every Anisette request and can still do it from two threads at once; that is
issue wanderdev0#135, which now carries this analysis.

First fully clean local run today: 575 tests, no failures, no abort.

Co-Authored-By: Claude Opus 5 <[email protected]>
saamdotexe pushed a commit to saamdotexe/OpenTagViewer that referenced this pull request Oct 22, 2026
Keep the logcat, and say when the suite aborted instead of "2 tests failed"
saamdotexe pushed a commit to saamdotexe/OpenTagViewer that referenced this pull request Oct 22, 2026
CI aborted this branch's suite at 335 of 564 tests. The logcat artefact added
in wanderdev0#130 caught what nothing had caught before - a native crash, with a stack:

    AnisetteStatus.of -> LocalAnisette.ensureReady -> LocalAnisette.load
      -> AdiLibrary.initialise -> NativeAdi.callWithPath
      -> libstoreservicescore.so
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), tid RxCachedThreadS

MapsActivity asks for Anisette on the way to restoring a session, and the real
source dlopens Apple's library and initialises it. Correct in the app. In a
suite it happens once per test, in one process, on whichever Rx thread got
there first - and sometimes it segfaults. A native crash takes the whole
instrumentation with it, so the run does not fail, it *stops*, and every
remaining test is reported as never having run.

That is almost certainly the intermittent whole-suite abort this repo has been
living with. It has been showing up as two arbitrary test names and
`Process crashed`, which is why it never got diagnosed: the names are whatever
was in flight, and the cause was in a logcat nobody kept.

The login-flow tests have always replaced Anisette with a fake. The map fixture
never did, so every test built on it was loading the real thing - and nothing
built on it is testing Anisette. Now it does the same.

Found because a new test in this branch tripped it reliably enough to fail CI
rather than intermittently. Fixing the fixture rather than the test, because
the test was not doing anything unusual.

Co-Authored-By: Claude Opus 5 <[email protected]>
saamdotexe pushed a commit to saamdotexe/OpenTagViewer that referenced this pull request Oct 22, 2026
Three whole-suite aborts today, each naming different tests, each the same
native crash - and the logcat artefact from wanderdev0#130 is what finally identified it.

The trigger is ordinary: a session that cannot be restored. MapsActivity asks
for Anisette on one thread, the restore fails, the app sends the user to the
login screen, and that asks for Anisette on another - two real LocalAnisette
instances at once. `ensureReady()` is synchronized on the instance, so two
instances is no mutual exclusion at all, and the log shows both threads
unpacking the same .so files before dlopening them:

    2419  AdiLibraryFetcher: libstoreservicescore.so: 2.39 MB unpacked
    2570  AdiLibraryFetcher: libstoreservicescore.so: 2.39 MB unpacked

A native crash takes the instrumentation with it, so the run does not fail, it
stops - and the tests it names are whichever were in flight.

Faked in the four classes that drive an activity without the map fixture, which
already got this. Worth doing on its own terms even after the app is fixed:
these tests were *downloading* Apple's libraries during the suite - the log
says "downloaded 2.6 MB of 142 MB" - which is a network dependency nobody asked
for, in tests that are not about Anisette.

**This is a workaround, not the fix.** The app still re-initialises ADI on
every Anisette request and can still do it from two threads at once; that is
issue wanderdev0#135, which now carries this analysis.

First fully clean local run today: 575 tests, no failures, no abort.

Co-Authored-By: Claude Opus 5 <[email protected]>
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.

1 participant