Skip to content

Wait for the app to leave the foreground before the single-top push - #18

Merged
LucaCappelletti94 merged 1 commit into
mainfrom
c2-single-top-race
Oct 12, 2026
Merged

LucaCappelletti94 merged 1 commit into
mainfrom
c2-single-top-race

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Owner

SingleTopTapTest, added in #13, failed in 7 of 47 runs of the API 35 emulator job and 1 of 47 on API 29, and twice in a row on #17. The test sends a notification push right after pressing home, and firebase-messaging shows a notification only when the process importance is below IMPORTANCE_FOREGROUND (DisplayNotification.isAppForeground in 25.1.3). A push that lands before the Activity stops goes to onMessageReceived instead, so the shade never gets the notification the test waits 90 seconds to tap. Run 15 times on a Galaxy A35 with Android 15, the test failed once, and in that run the probe received the push 34 ms before TapActivity stopped.

The test now waits, within UI_MS, for the process to leave the foreground before it sends, which is the same check FCM makes. With that change the same loop passed 30 times out of 30, and no push reached the handler.

No CI log showed any of this, because run.sh kept the last 300 device lines containing pushups, which the UI polls for the notification title and every system line naming the package filled. The dump now selects the crate's tag, the FCM tags and the activity and test runner tags, and on the A35 failure it keeps the foreground delivery and the error in view.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: LucaCappelletti94/coderabbit/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 433777ad-2905-492b-acb8-bb4f908e4c06

  • 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.

@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.16%. Comparing base (8c15151) to head (3d2acf2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #18   +/-   ##
=======================================
  Coverage   92.16%   92.16%           
=======================================
  Files          33       33           
  Lines        2910     2910           
  Branches       39       39           
=======================================
  Hits         2682     2682           
  Misses        201      201           
  Partials       27       27           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@LucaCappelletti94
LucaCappelletti94 merged commit 6c4a607 into main Oct 12, 2026
31 checks passed
@LucaCappelletti94
LucaCappelletti94 deleted the c2-single-top-race branch October 12, 2026 22:19
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