Skip to content

test: let the wallet module's Robolectric tests start (251 tests across 25 classes) - #1609

Merged
HashEngineering merged 1 commit into
feat/kotlin-sdk-phase-1from
chore/robolectric-conscrypt-off
Oct 22, 2026
Merged

HashEngineering merged 1 commit into
feat/kotlin-sdk-phase-1from
chore/robolectric-conscrypt-off

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

One line in wallet/test/robolectric.properties. It makes 251 unit tests across 25 classes start — they have never run.

What is broken

Every Robolectric test in :wallet fails in setup, before any test code runs:

java.lang.UnsatisfiedLinkError: no conscrypt_jni in java.library.path: …
	at java.lang.System.loadLibrary(System.java:1989)
	at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:28)
	at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:64)
	at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:58)
	at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(:169)
	at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:309)

Two builds of Conscrypt define the same org.conscrypt.* classes on _testNet3DebugUnitTestRuntimeClasspath:

artifact comes from how it loads its native library
org.conscrypt:conscrypt-android:2.5.3 wallet/build.gradle (TLS 1.3 on Android ≤ 9) System.loadLibrary("conscrypt_jni") — a .so that only exists inside an APK
org.conscrypt:conscrypt-openjdk-uber:2.5.2 org.robolectric:robolectric:4.15.1 extracts libconscrypt_openjdk_jni-linux-x86_64.so from its jar; works on a desktop JVM

The Android build wins, and Robolectric installs Conscrypt as its security provider during setup, so it is the Android loader that runs. This is a classpath conflict in the module, not a property of any one machine.

What this changes

conscryptMode=OFF leaves the JVM's default security provider in place under Robolectric. Host unit tests make no real TLS connections, so nothing in them depends on Conscrypt.

The alternative — excluding conscrypt-android from the unit-test runtime classpaths — keeps Conscrypt installed under Robolectric, but it is more build logic to maintain for no test-visible gain. The app's own classpath is untouched either way: this file applies to host unit tests only.

Result

:wallet:test_testNet3DebugUnitTest at 3254b0a29 (feat/kotlin-sdk-phase-1)
  before:  2616 tests, 252 failed, 1 skipped     (251 Conscrypt + 1 real)
  after:   2616 tests,   1 failed, 1 skipped

Every one of the 251 recovered tests passes. Nothing to triage. The 25 classes include the SDK cutover, tx-store, asset-lock, display-cache and send-path suites.

The one remaining failure is PlatformSyncEngineRestartTest.resume_isRearmableAcrossRepeatedStopRestartCycles, which fails identically without this change. It is not fixed here.

Two things this does NOT do

1. CI still does not run these tests. .github/workflows/dashwallet.yml runs fastlane test flavor:"" type:"debug", and the lane (fastlane/Fastfile:171-175) turns that into gradle testDebugUnitTest from the root project. :wallet has only flavored variants (_testNet3Debug, prodDebug, stagingDebug, devnetDebug), so it has no testDebugUnitTest task and Gradle skips the module. A green build covers common, crowdnode, coinbase, uphold, maya and exploredash — about 2,600 wallet tests are not among them.

Switching CI to :wallet:test_testNet3DebugUnitTest is the obvious follow-up, but it would be red on day one because of the test below, so it belongs in its own change.

2. It does not fix that test. For whoever picks it up: the test does stopSdkEngines(); resume() three times in a tight loop and asserts three startIfEnabled() calls; it sees three stops and two starts. resume() → kickSdkEngines() launches a job that bindJob.join()s before starting the engine, and stopSdkEngines() cancels startupKickJob. A kick cancelled by the next stop is the designed behaviour; the test assumes it is not cancellable. That reading comes from the code, not from a fix — it has not been verified by changing anything.

How this was found

QA of the dashj→SDK cutover. Review of #1605 asked to see SdkTxidHeightsQueryTest run; it could not, which is how the conflict surfaced. With this line it passes 2/2.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated the automated test environment’s security configuration. This change affects test setup only; no changes to app functionality or user-facing behavior are included in this release.

…OFF)

251 of the wallet module's unit tests, across 25 classes, have not been
running. They fail in Robolectric's setup, before any test code runs:

    java.lang.UnsatisfiedLinkError: no conscrypt_jni in java.library.path
      at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:28)
      at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:58)
      at AndroidTestEnvironment.setUpApplicationState(:169)

Two builds of Conscrypt define the same org.conscrypt.* classes on
_testNet3DebugUnitTestRuntimeClasspath: conscrypt-android:2.5.3, which
wallet/build.gradle pulls in for TLS 1.3 on Android <= 9, and
conscrypt-openjdk-uber:2.5.2, which Robolectric 4.15.1 brings. The
Android build wins, and it loads its native library with
System.loadLibrary("conscrypt_jni") — a .so that only exists inside an
APK. Robolectric installs Conscrypt as its security provider during
setup, so every Robolectric test in the module dies there.

Turning that step off leaves the JVM's default security provider in
place. Host unit tests make no real TLS connections, so nothing in them
depends on Conscrypt. The alternative — excluding conscrypt-android from
the unit-test runtime classpaths — keeps Conscrypt under Robolectric but
is more build logic to maintain for no test-visible gain.

    :wallet:test_testNet3DebugUnitTest at 3254b0a
      before:  2616 tests, 252 failed, 1 skipped
      after:   2616 tests,   1 failed, 1 skipped

Every one of the 251 recovered tests passes. The remaining failure is
PlatformSyncEngineRestartTest.resume_isRearmableAcrossRepeatedStopRestartCycles,
which predates this change and is unrelated to it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: dashpay/dash-wallet/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1990d6ef-d3d3-4783-b54f-ab747c3ec5a7

📥 Commits

Reviewing files that changed from the base of the PR and between 3254b0a and 1340bb8.


📒 Files selected for processing (1)
  • wallet/test/robolectric.properties

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.



📝 Walkthrough

Walkthrough

The Robolectric test configuration adds conscryptMode=OFF.

Changes

Robolectric configuration

Layer / File(s) Summary
Conscrypt mode setting
wallet/test/robolectric.properties
The Robolectric configuration sets conscryptMode to OFF.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to 1340b

This host-test configuration change has no established remaining failure path or merge blocker.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the change: enabling the wallet module's Robolectric tests to start. It is specific and consistent with the one-line Conscrypt configuration change.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit 1340bb8) · triage: low

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

The one-line Robolectric configuration change is scoped to host-test resources and leaves production dependencies and TLS configuration unchanged. Static verification found no blocking defect, but two test comments now incorrectly describe the Conscrypt setup failure as ongoing. The supplied CI checks passed, although the existing CI task does not execute the wallet's flavored unit tests and therefore does not independently verify the reported recovery counts.

💬 1 nitpick(s)

1 finding(s) not shown inline (the lines are not part of this PR's diff)

💬 Nitpick: Remove the now-stale Conscrypt failure explanation from both test comments
wallet/test/de/schildbach/wallet/ui/payments/PaymentsReceiveAddressRequestTest.kt:82-84

The new module-wide conscryptMode=OFF configuration disables the Robolectric provider installation responsible for the missing conscrypt_jni failure. This comment and ReceiveAddressFailureVisibilityTest.kt:40-43 still say every Robolectric test currently fails for that reason, incorrectly telling contributors that fragment-level coverage remains blocked by the runner. Remove that parenthetical explanation from both comments while retaining their description of the fragment-level behaviors these tests do not cover; this does not require adding new tests.

 * Robolectric/instrumented concerns (fragment-level UI behavior), so they are
 * not covered here — only the state they read is.

source: glm-5.3-flash (phase1-reviewer: general)

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — The one-line Robolectric configuration change alters host-test security-provider setup but is straightforward, well-contained, and leaves application behavior untouched.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 100% left, weekly 87% left; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 14% left, 5h 38% left)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `wallet/test/de/schildbach/wallet/ui/payments/PaymentsReceiveAddressRequestTest.kt`:
- [NITPICK] wallet/test/de/schildbach/wallet/ui/payments/PaymentsReceiveAddressRequestTest.kt:82-84: Remove the now-stale Conscrypt failure explanation from both test comments
  The new module-wide `conscryptMode=OFF` configuration disables the Robolectric provider installation responsible for the missing `conscrypt_jni` failure. This comment and `ReceiveAddressFailureVisibilityTest.kt:40-43` still say every Robolectric test currently fails for that reason, incorrectly telling contributors that fragment-level coverage remains blocked by the runner. Remove that parenthetical explanation from both comments while retaining their description of the fragment-level behaviors these tests do not cover; this does not require adding new tests.
Out-of-scope follow-up suggestions (1)

These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.

  • CI's test lane silently skips the entire :wallet module (~2,600 tests) — Outside this PR's scope: the workflow passes an empty flavor to the Fastlane test lane, which constructs testDebugUnitTest, while wallet defines only flavored variants. Neither configuration changes in this PR, and the author already explicitly documents the gap and the separate follow-up. This pre-existing test gap is not retained as an additional review finding.
    • Follow-up: Consider creating a separate issue or author/maintainer-requested PR for this.

@HashEngineering
HashEngineering merged commit 421514a into feat/kotlin-sdk-phase-1 Oct 22, 2026
3 checks passed
@HashEngineering
HashEngineering deleted the chore/robolectric-conscrypt-off branch October 22, 2026 07:14
HashEngineering added a commit that referenced this pull request Oct 23, 2026
Brings in #1584, #1621 and #1609. build.gradle: the base's dppVersion
5.0.0-20261016.200955-3 block (#1621) sits right after the SDK pin; kept it
whole, together with the int31 pin. The recipe pointer now names
HashEngineering/dash-wallet-qa, where the 5.0.0-int31 recipe is published.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HashEngineering added a commit that referenced this pull request Oct 23, 2026
…rge/master-into-kotlin-sdk-phase-1-v11.9.1

Brings in 421514a (#1609), a2394ec (#1621) and 1e5fb13 (#1584).

Conflicts resolved by keeping both sides:
- TopUpRepository: the constructor takes this branch's
  pendingPaymentVerifier and #1584's dashSdkService.
- ShieldedBalanceServiceImpl: the internal constructor keeps this
  branch's freshFundingBlocked (the funding gate) and #1621's clock and
  afterCoverageRead seams.
- SdkTransparentUsernameCreationTest: both sides' added tests.

The funding gate is not bypassed. #1621 only shows the shielded balance
in the home total, and #1584 only changes the funding amount (the
protocol-gated contested fee). The gate still runs before every fresh
SDK funding build: the transparent username creation, the L1 invite and
the shielded balance's shield from the wallet. No new spend call comes
in.
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