Skip to content

Stabilize HelloCodenameOne orientation screenshot capture#4574

Merged
shai-almog merged 1 commit intomasterfrom
codex/fix-flaky-orientation-test-in-hellocodenameone
Feb 26, 2026
Merged

Stabilize HelloCodenameOne orientation screenshot capture#4574
shai-almog merged 1 commit intomasterfrom
codex/fix-flaky-orientation-test-in-hellocodenameone

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • The orientation screenshot test could capture a portrait image because it used a fixed 300ms delay after requesting landscape, which is insufficient on slower devices or simulators.

Description

  • In scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/OrientationLockScreenshotTest.java replaced the fixed UITimer.timer(300, ...) delay with a call to waitForOrientation(this, false, ...) so the test waits for confirmed landscape before calling Cn1ssDeviceRunnerHelper.emitCurrentFormScreenshot("landscape"), while preserving the subsequent re-lock-to-portrait and verification.

Testing

  • Attempted to compile the module with cd scripts/hellocodenameone && mvn -pl common -am -DskipTests compile, but the build could not complete due to a missing plugin artifact com.codenameone:codenameone-maven-plugin:8.0-SNAPSHOT, so no automated tests were executed in this environment.

Codex Task

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 26, 2026

Android screenshot updates

Compared 32 screenshots: 31 matched, 1 error.

  • graphics-draw-round-rect — comparison error. Comparison error: PNG chunk truncated before CRC while processing: /home/runner/work/_temp/cn1ss-NRCJAd/graphics-draw-round-rect.png

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

Native Android coverage

  • 📊 Line coverage: 7.32% (3722/50867 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.71% (18271/320093), branch 2.75% (855/31113), complexity 3.42% (1017/29746), method 6.03% (836/13858), class 9.83% (180/1831)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 26, 2026

iOS screenshot updates

Compared 32 screenshots: 31 matched, 1 updated.

  • landscape — updated screenshot. Screenshot differs (2556x1179 px, bit depth 8).

    landscape
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as landscape.png in workflow artifacts.

Benchmark Results

  • VM Translation Time: 325 seconds
  • Compilation Time: 247 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 24290 ms
Extract Extensions 18 ms
Google Services Setup 1 ms
Scan Classes 590 ms
Extract Libs 906 ms
Inject Build Hints 36 ms
Generate Unit Tests 2 ms
Generate Stubs 998 ms
Compile Stubs 2152 ms
Generate Icons 890 ms
Prepare ParparVM 155 ms
ParparVM Execution 205272 ms
Post-VM Setup 288 ms
CocoaPods 6415 ms
Finalize 42 ms
Total Time 242055 msMaven Overhead : 83000 ms
CocoaPods Install (Script) 2000 ms
Simulator Boot 117000 ms
Simulator Boot (Run) 3000 ms
App Install 19000 ms
App Launch 9000 ms
Test Execution 160000 ms

@codenameone codenameone deleted a comment from TonGalaxy Feb 26, 2026
@shai-almog shai-almog merged commit 16076d0 into master Feb 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant