Problem/Motivation
To reproduce, try creating a commerce order aggregate sensor, that will work when manually testing but not when running the query as anonymous user because then the query alters from commerce kicks in.
Proposed resolution
Add $query->accessCheck(FALSE); to the entity query.
Comments
Comment #2
mbovan commentedWe have to do this for both entity query and entity query verbose.
Comment #3
mbovan commentedAdded tests in
Drupal\Tests\monitoring\Functional\MonitoringCommerceTest.Comment #6
berdirThanks, committed.