[fix][test] Fix flaky EndToEndMetadataTest.testPublishConsume#25002
[fix][test] Fix flaky EndToEndMetadataTest.testPublishConsume#25002hanmz wants to merge 1 commit intoapache:masterfrom
Conversation
lhotari
left a comment
There was a problem hiding this comment.
Therefore, we cannot configure it to 4 here; instead, we must use the default value Math.max(8, 2 * Runtime.getRuntime().availableProcessors())
One of the goals in setting the value is to use minimal amount of threads. Removing of the value would set the value to 64 on a 32 core machine like yours. That seems a lot for testing.
Have you checked what the minimal value is?
We could consider passing -XX:ActiveProcessorCount=4 to the test JVM args to address test behavior differences across environments. The reason why that would make sense is that the tests would behave closer to how they behave in GitHub Actions based CI (GitHub Actions VM specs) when the number of threads are similar across environments.
By default, the Pulsar maven build has the setting testForkCount=4 which will run tests in 4 JVMs in parallel.
Motivation
When executing this test case in a 16C32G Linux environment, the following error will be encountered. The problem is that Jetty requires more than 4 threads. Therefore, we cannot configure it to 4 here; instead, we must use the default value
Math.max(8, 2 * Runtime.getRuntime().availableProcessors())Modifications
Use the default values configured for
numHttpServerThreads.Documentation
docdoc-requireddoc-not-neededdoc-complete