I am writing a bunch of load tests on my ElasticSearch Index. I need to setup and teardown my index in the load test. Towards this I wrote this code
before {
println("going to setup index")
scenario("SetupIndex")
.exec(
http("createindex")
.put("/test")
)
.inject(atOnceUsers(1))
.protocols(httpConf)
}
setUp(
scn
.inject(
constantUsersPerSec(10) during (60 seconds) randomized
)
.protocols(httpConf)
)
after {
scenario("DeleteIndex")
.exec(
http("deleteindex")
.delete("/test")
)
.inject(atOnceUsers(1))
.protocols(httpConf)
println("finished executing cleanup....")
}
I see that it prints "finished executing cleanup" but it doesn't really do the delete. I can easily delete index via curl -XDELETE http://localhost:9200/test
When I run my simulation. it runs successfully. but I can see that the test index is still there.