Why it fails:
- InboxMessageReadTest never creates inbox messages. It expects 3 to exist because commerce_install() calls fetchNewStoreMessages(), which downloads https://www.centarro.io/drupal-commerce/new-store-messages.json while the test site is being installed.
- If that request fails in CI (timeout, network problem, the CI runner being blocked), the fetcher logs the exception and carries on with no messages.
- With no messages, the foreach that checks each message's .unread element loops zero times and passes. The next assertion fails because DashboardController::getInbox() renders an empty unread_text when nothing is unread. That's the exact error you pasted: .inbox-header__unread-text not found.
- The feed works from here right now (HTTP 200 in 0.7s, 3 messages), which fits the run-to-run flakiness. The 3.x run on 3d04eef2b failed and the next two passed with the same code.

Fix (separate from #3634141): make the test self-contained.
- Set commerce_dashboard_fetch_inbox_messages to FALSE so the test never hits the network.
- Create the 3 unread messages in the test with commerce.inbox_message_storage->save().
- Optionally, assert that the message count is 3 before the foreach, so an empty inbox fails clearly instead of silently.

Issue fork commerce-3634148

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jsacksick created an issue. See original summary.

  • jsacksick committed 8e214546 on 3.x
    Issue #3634148: InboxMessageReadTest fails randomly because it depends...
jsacksick’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.