NebulaLogger icon indicating copy to clipboard operation
NebulaLogger copied to clipboard

CallableLogger_Tests: System.UnexpectedException

Open brendannova opened this issue 3 months ago • 2 comments

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

v4.16.5

New Bug Summary

The above test class seems to be failing intermittently. There doesnt seem to be any good rational to determine why we see these issues.

it_adds_new_entry_with_tags_when_using_standard_approach

System.UnexpectedException: class java.lang.String cannot be cast to class java.lang.Integer (java.lang.String and java.lang.Integer are in module java.base of loader 'bootstrap')
Stack Trace: External entry point

any help understanding this would be greatly appreciated

brendannova avatar Oct 01 '25 13:10 brendannova

@brendannova we saw this start to happen intermittently as well; I believe @jongpie has a pending fix for this already

jamessimone avatar Oct 01 '25 14:10 jamessimone

@brendannova In the test class function it_adds_new_entry_with_tags_when_using_standard_approach, as a quick fix, go to line 564 and change it to:

List<Object> tags = new List<Object>{ 'some-tag', 'another-tag', '1' };

Basically, just wrap the 1 in quotes.

While reviewing the code, I noticed that in the CallableLogger class (around line 164), each tag is being converted to a string with:

logEntryEventBuilder.addTag(tag?.toString());

So adding the quotes ensures the value is handled consistently.

I didn’t get time to dig deep into the code yet, but this quick change should resolve the test failure for now.

SibilJoeKurian avatar Oct 08 '25 16:10 SibilJoeKurian