Do not warn about getting service from under write action in tests. Too many positives.

This commit is contained in:
Alexey Kudravtsev
2016-07-27 15:20:56 +03:00
parent d747b64215
commit c42fc2ad45
@@ -222,7 +222,11 @@ public class ServiceManagerImpl implements BaseComponent {
ComponentAdapter delegate = getDelegate();
// useReadActionToInitService is enabled currently only in internal or test mode or explicitly (registry) - we have enough feedback to fix, so, don't disturb all users
if (!useReadActionToInitService && LOG.isDebugEnabled() && ApplicationManager.getApplication().isWriteAccessAllowed() && PersistentStateComponent.class.isAssignableFrom(delegate.getComponentImplementation())) {
if (!useReadActionToInitService &&
LOG.isDebugEnabled() &&
ApplicationManager.getApplication().isWriteAccessAllowed() &&
!ApplicationManager.getApplication().isUnitTestMode() &&
PersistentStateComponent.class.isAssignableFrom(delegate.getComponentImplementation())) {
LOG.warn(new Throwable("Getting service from write-action leads to possible deadlock. Service implementation " + myDescriptor.getImplementation()));
}