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

PeerScoringReporterService is not properly released in unit tests #1647

Open
Vovchyk opened this issue Nov 3, 2021 · 0 comments
Open

PeerScoringReporterService is not properly released in unit tests #1647

Vovchyk opened this issue Nov 3, 2021 · 0 comments
Labels

Comments

@Vovchyk
Copy link
Contributor

Vovchyk commented Nov 3, 2021

Sometimes while running unit tests the following error appears:

com.fasterxml.jackson.databind.JsonMappingException: [no message for java.lang.NullPointerException]
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:303)
        at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3681)
        at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3057)
        at co.rsk.scoring.PeerScoringReporterUtil.detailedReputationString(PeerScoringReporterUtil.java:50)
        at co.rsk.scoring.PeerScoringReporterService.printReports(PeerScoringReporterService.java:62)
        at co.rsk.scoring.PeerScoringReporterService.lambda$start$0(PeerScoringReporterService.java:38)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: null
        at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:124)
        at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:112)
        at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:292)
        ... 12 common frames omitted

Seems that the PeerScoringReporterService is not properly disposed in the tests.

Note: this console output doesn't prevent the tests to succeed though.

Note 2: this does not happen on each run - appears on occasional basis

@Vovchyk Vovchyk added the bug label Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant