# Elasticsearch.esplugin: Replace/Change/Disable integTestCluster#wait Task

**URL:** https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006
**Category:** Elasticsearch
**Created:** [January 11, 2018, 6:06am UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006 "2018-01-11T06:06:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![varundbest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varundbest/32/48066_2.png) [@varundbest](https://discuss.elastic.co/u/varundbest)
#### Post date: [January 11, 2018, 6:06am UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006/1 "2018-01-11T06:06:19Z")

</div>

I am trying to use elasticsearch.esplugin for integration tests on my plugin (Have already Set those up for Maven: [david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/](http://david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/)) but as soon as I use it, I get loads of errors telling me to write param descriptions, etc.

I have already set:  
checkstyleMain.enabled = false  
checkstyleTest.enabled = false

And i wish to replace the elasticsearch.yml with mine (Custom Settings) and add another file to the same  
Config folder before starting the ES Cluster.  
Seems like I have to access this :-

> <https://github.com/elastic/elasticsearch/blob/5.4/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy#L178>

But how?

I'm unable to find any docs on this, any Ideas?

Edit:

I'm running into: "Elasticsearch cluster failed to pass wait condition"  
Now the thing is that, my plugin implements security and is expected to return 403 upon pining without JWT Token, How shall I change the task 'integTestCluster#wait'? to expect 403?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [January 11, 2018, 8:12am UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006/2 "2018-01-11T08:12:51Z")

</div>

For another project with gradle, I used something like:

```auto
buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath "org.elasticsearch.gradle:build-tools:6.0.0"
    }
}

apply plugin: 'java'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'idea'
apply plugin: 'maven'

// this is temporal and will be fixed in 6.0
ext.projectSubstitutions = [:]

// license of this project
licenseFile = rootProject.file('LICENSE.txt')
// copyright notices
noticeFile = rootProject.file('NOTICE.txt')

esplugin {
    // license of the plugin, may be different than the above license
    licenseFile rootProject.file('LICENSE.txt')
    // copyright notices, may be different than the above notice
    noticeFile rootProject.file('NOTICE.txt')
    name 'foo'
    description 'foo'
    classname 'fr.pilato.elasticsearch.plugin.foo.FooPlugin'
}

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
}

// In this section you declare the dependencies for your production and test code
// Elasticsearch dependency is included due to the build-tools, test-framework as well
dependencies {
    testCompile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.0.0'
}

integTestCluster {
    setting 'foo.whatever.setting', 'bar'
}

thirdPartyAudit.excludes = [
        // classes are missing
        'javax.servlet.ServletConfig',
        'javax.servlet.ServletContext',
        'javax.servlet.ServletContextEvent',
        //... Skipped for clarity
]

artifacts {
    archives javadocJar, sourcesJar
}

```

I hope this could help. (May be)... 🙂

Note that I'm using 6.0 here.

---

<div class="post-metadata">

### Author: ![varundbest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varundbest/32/48066_2.png) [@varundbest](https://discuss.elastic.co/u/varundbest)
#### Post date: [January 11, 2018, 8:45am UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006/3 "2018-01-11T08:45:33Z")

</div>

Thanks! Btw, I'm running into: "Elasticsearch cluster failed to pass wait condition"  
Now the thing is that, my plugin implements security and is expected to return 403 upon pining without JWT Token, How shall I change the task 'integTestCluster#wait'? to expect 403?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [January 11, 2018, 8:47am UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006/4 "2018-01-11T08:47:29Z")

</div>

I dunno... 😛

---

<div class="post-metadata">

### Author: ![varundbest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varundbest/32/48066_2.png) [@varundbest](https://discuss.elastic.co/u/varundbest)
#### Post date: [January 11, 2018, 12:46pm UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006/5 "2018-01-11T12:46:43Z")

</div>

Will it work if I change this :-

> <https://github.com/elastic/elasticsearch/blob/5.4/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy#L105>

Follow Up question, how to change it from build.gradle?

See, there is this Task:  
task ':integTestCluster#init'

Which creates:  
'integTestCluster#checkPrevious', 'integTestCluster#clean', 'integTestCluster#configure', 'integTestCluster#copyPlugins', 'integTestCluster#extraConfig', 'integTestCluster#extract', 'integTestCluster#init', 'integTestCluster#installAuthenticatePlugin', 'integTestCluster#prepareCluster.cleanShared', 'integTestCluster#start', 'integTestCluster#stop', 'integTestCluster#stopPrevious', 'integTestCluster#wait'.

And Now I want to disable 'integTestCluster#wait' and latch my task after 'integTestCluster#start' but I cannot do it because they don't exist before ':integTestCluster#init' runs and all of them run inside ':integTestCluster#init'.  
Anything?

---

<div class="post-metadata">

### Author: ![varundbest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varundbest/32/48066_2.png) [@varundbest](https://discuss.elastic.co/u/varundbest)
#### Post date: [January 11, 2018, 2:31pm UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006/6 "2018-01-11T14:31:48Z")

</div>

Solution:  
integTestCluster {  
waitCondition = {  
param1, param2 -\>  
sleep(5 \* 1000)  
return true  
}  
}  
Wait Condition can be replaced like this.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 8, 2018, 2:32pm UTC](https://discuss.elastic.co/t/elasticsearch-esplugin-replace-change-disable-integtestcluster-wait-task/115006/7 "2018-02-08T14:32:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
