We have some tests that use System.runAs for a User created like this:

    Contact c = ...;

    Profile p = [
        select Id
        from Profile
        where UserType = 'CspLitePortal'
        limit 1
    insert u = new User(
        ProfileId = p.id,
        ContactId = c.id,

and they have started failing in the last 2 weeks. Seems like a sharing problem, where the test - running as a SA User - inserts rows, but the System.runAs User can't see them for custom objects and objects like Attachment.

Anyone else having this problem? Summer '19? Or a side effect of Multi-Instance Core and Communities Service Disruption starting May 17, 2019? Workarounds?


Changing with sharing to without sharing eliminates the problem but is not a change that makes sense for production use.


1 Answer 1


This is related to Summer'19 changes:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.