diff --git a/Modules/IO/TestKernel/include/otbTestMain.h b/Modules/IO/TestKernel/include/otbTestMain.h
index 83e8126cb58e2ab61a548f492090cb74c8384373..e6b0e31aac31a8d5e9457309350b6366d19144f1 100644
--- a/Modules/IO/TestKernel/include/otbTestMain.h
+++ b/Modules/IO/TestKernel/include/otbTestMain.h
@@ -74,8 +74,6 @@ int main(int ac, char* av[])
   otb::MPIConfig::Instance()->Init(ac,av);
   #endif
 
-  otb::ConfigurationManager::InitOpenMPThreads();
-  
   bool   lFlagRegression(false);
   double lToleranceDiffValue(0);
   double lEpsilon(0);
@@ -290,6 +288,8 @@ int main(int ac, char* av[])
     testToRun = av[1];
     }
 
+  otb::ConfigurationManager::InitOpenMPThreads();
+
   std::map<std::string, MainFuncPointer>::iterator j = StringToTestFunctionMap.find(testToRun);
   // If the test doesn't exists
   if ( j == StringToTestFunctionMap.end() )