-
Notifications
You must be signed in to change notification settings - Fork 534
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
Flaky test testMultiThread4HighRace and testMultiThread4LowRace #101
Labels
bug
Something isn't working
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
MyPerf4J/MyPerf4J-Base/src/test/java/cn/myperf4j/base/util/concurrent/AtomicIntHashCounterTest.java
Line 165 in 9cea8c5
ExecutorService newFixedThreadPool(int nThreads)
method creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue. And it will throw error messageIllegalArgumentException
ifnThreads <= 0
.The author initially set the
threadCnt
toavailableProcessors() - 2
to maybe avoid occupying too many computing resources. However, when the machine we use has less than 2 processors, an error will arise.Environment
Steps to Reproduce
Error message:
(The error message is the same for
testMultiThread4LowRace
)The text was updated successfully, but these errors were encountered: