Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing Unit Test: LogFlowExecutionErrorEventHandler_Tests. it_logs_when_enabled #817

Open
kacrouse opened this issue Dec 11, 2024 · 4 comments
Assignees
Labels
Plugin: Async Failure Additions Items related to the plugin Async Failure Additions tests Relates to Apex or LWC jest tests Type: Bug Something isn't working

Comments

@kacrouse
Copy link
Contributor

kacrouse commented Dec 11, 2024

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

4.15.1

New Bug Summary

Error message: System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.LogFlowExecutionErrorEventHandler_Tests.it_logs_when_enabled: line 29, column 1

Failing line:

System.runAs(new Schema.User(Id = [SELECT Id FROM User WHERE Alias = 'autoproc'].Id)) {

It's looking for the automated process user which does not exist in my org. Not sure I've ever seen an org without this user, so this is interesting. I do have several Platform Integration Users, and one of them is the context user for firing platform events—which I think used to be automated process? so maybe SF has made some changes...

This isn't blocking me from doing anything, just calling it out as it's something I've noticed for a bit.

@kacrouse kacrouse added the Type: Bug Something isn't working label Dec 11, 2024
@jongpie
Copy link
Owner

jongpie commented Dec 16, 2024

@kacrouse thanks so much for reporting this! My guess is that the autoproc user now has a different alias, so I'll look into other ways to try to query it. Once I've had some time to look into it a little more, I'll let you know what I find/if I have any follow up questions.

@jongpie jongpie self-assigned this Dec 16, 2024
@jongpie jongpie added tests Relates to Apex or LWC jest tests Plugin: Async Failure Additions Items related to the plugin Async Failure Additions labels Dec 16, 2024
@jongpie
Copy link
Owner

jongpie commented Dec 16, 2024

@kacrouse just a quick follow-up question - have you tried this in multiple orgs/sandboxes? If so, does the test fail in all of your orgs? Or is the autoproc user only missing in some orgs/environments?

@kacrouse
Copy link
Contributor Author

I can confirm it doesn't exist in production or any sandboxes for the org I work with. I checked a couple dev editions though and it existed in those.

@jongpie
Copy link
Owner

jongpie commented Dec 17, 2024

Awesome, thanks for the info! Offhand, I'm not sure how to handle this, but since it's not currently blocking you, I'll revisit this in the near future to see if I can find a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugin: Async Failure Additions Items related to the plugin Async Failure Additions tests Relates to Apex or LWC jest tests Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants