CallableLogger_Tests: System.UnexpectedException
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 we saw this start to happen intermittently as well; I believe @jongpie has a pending fix for this already
@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.