Description
I have a test that checks that some specific static calls are not used in my code: PluginArchitectureTest.java#L33. I introduced a violation of this rule in my PR, see IssuesChartPortlet.java#L54.
When I use this rule it works perfectly in a VM and in GitHub Actions, but the rule fails on my local machine (MacBook) or sometimes in our CI (see PR jenkinsci/warnings-ng-plugin#546 and CI results (Windows fails, Linux succeeds).
I'm not sure if I use some concepts in the wrong way or if this is a bug that occurs only sometimes.
E.g. if I use the annotation @AnalyzeClasses(packages = "io.jenkins.plugins.analysis")
then the test succeeds on my machine. If I restrict the scanned packages to @AnalyzeClasses(packages = "io.jenkins.plugins.analysis.core.portlets")
then the test correctly fails. Is this a concurrency problem? Or is the usage of the static fields for the tests a problem? I tried to debug this issue but actually I am a bit of lost when the rules are dynamically invoked. Maybe you can give me some hints on how to find the root cause for this problem.