java - Why does SpringJUnit4ClassRunner not work with surefire parallel=methods? -


why tests throw random exceptions when use surefire setting parallel=methods ?

that's because junit creates 1 runner instance per test class, used multiple threads when using parallel=methods. springjunit4classrunner creates 1 testcontextmanager, stores test instance in instance field, isn't thread safe.

when use parallel=classes should fine, because junit creates 1 runner dedicated testcontextmanager per thread.

i have filed bug that: https://jira.spring.io/browse/spr-12421


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -