@@ -34,6 +34,7 @@ public class ElasticsearchNode : IDisposable
3434
3535 private readonly bool _doNotSpawnIfAlreadyRunning ;
3636 private readonly bool _shieldEnabled ;
37+ private readonly bool _skipPluginVerification ;
3738 private ObservableProcess _process ;
3839 private IDisposable _processListener ;
3940
@@ -103,11 +104,13 @@ public ElasticsearchNode(
103104 bool runningIntegrations ,
104105 bool doNotSpawnIfAlreadyRunning ,
105106 string name ,
106- bool shieldEnabled
107+ bool shieldEnabled ,
108+ bool skipPluginVerification
107109 )
108110 {
109111 this . _doNotSpawnIfAlreadyRunning = doNotSpawnIfAlreadyRunning ;
110112 this . _shieldEnabled = shieldEnabled ;
113+ this . _skipPluginVerification = skipPluginVerification ;
111114
112115 var prefix = name . ToLowerInvariant ( ) ;
113116 var suffix = Guid . NewGuid ( ) . ToString ( "N" ) . Substring ( 0 , 6 ) ;
@@ -212,9 +215,9 @@ public IObservable<ElasticsearchMessage> Start(string typeOfCluster, string[] ad
212215
213216 if ( handle . WaitOne ( this . HandleTimeout , true ) ) return observable ;
214217
215- this . Stop ( ) ;
218+ this . Stop ( ) ;
216219 throw new Exception ( $ "Could not start elasticsearch within { this . HandleTimeout } ") ;
217- }
220+ }
218221
219222#if DOTNETCORE
220223 private IObservable < ElasticsearchMessage > UseAlreadyRunningInstance ( Signal handle )
@@ -229,11 +232,13 @@ private IObservable<ElasticsearchMessage> UseAlreadyRunningInstance(ManualResetE
229232
230233 if ( ! alreadyUp . IsValid ) return null ;
231234
232- var checkPlugins = client . CatPlugins ( ) ;
233-
234- var missingPlugins = SupportedPlugins . Keys . Except ( checkPlugins . Records . Select ( r => r . Component ) ) . ToList ( ) ;
235- if ( missingPlugins . Any ( ) )
236- throw new Exception ( $ "Already running elasticsearch missed the following plugin(s): { string . Join ( ", " , missingPlugins ) } .") ;
235+ if ( ! _skipPluginVerification )
236+ {
237+ var checkPlugins = client . CatPlugins ( ) ;
238+ var missingPlugins = SupportedPlugins . Keys . Except ( checkPlugins . Records . Select ( r => r . Component ) ) . ToList ( ) ;
239+ if ( missingPlugins . Any ( ) )
240+ throw new Exception ( $ "Already running elasticsearch missed the following plugin(s): { string . Join ( ", " , missingPlugins ) } .") ;
241+ }
237242
238243 this . Started = true ;
239244 this . Port = 9200 ;
@@ -247,6 +252,8 @@ private IObservable<ElasticsearchMessage> UseAlreadyRunningInstance(ManualResetE
247252 return Observable . Empty < ElasticsearchMessage > ( ) ;
248253 }
249254
255+ private static object _licenseLock = new object ( ) ;
256+
250257 private void ValidateLicense ( )
251258 {
252259 var client = TestClient . GetClient ( ) ;
@@ -278,8 +285,6 @@ private void ValidateLicense()
278285
279286 if ( license . License . Status == LicenseStatus . Invalid )
280287 throw new Exception ( $ "{ exceptionMessageStart } but the license is invalid!") ;
281-
282-
283288 }
284289
285290#if DOTNETCORE
0 commit comments