# Local node indexing for unit testing behaves differently in 0.11.0

**URL:** <https://discuss.elastic.co/t/local-node-indexing-for-unit-testing-behaves-differently-in-0-11-0/3386>\
**Category:** Elasticsearch\
**Created:** [September 30, 2010, 12:40am UTC](https://discuss.elastic.co/t/local-node-indexing-for-unit-testing-behaves-differently-in-0-11-0/3386 "2010-09-30T00:40:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmcclure1](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@dmcclure1](https://discuss.elastic.co/u/dmcclure1)\
**Post date:** [September 30, 2010, 12:40am UTC](https://discuss.elastic.co/t/local-node-indexing-for-unit-testing-behaves-differently-in-0-11-0/3386/1 "2010-09-30T00:40:43Z")

</div>

I have a number of unit tests that utilize a local node. Each test  
starts a node, checks for the existence of an index the unit test will  
be working with and creates the index if it does not exist.

In 0.10.0, the same index would get created for each unit test  
(exception would be thrown for a count against the index and I would  
create the index). Any documents that I index are never persisted  
across a given unit test.

In 0.11.0, exception is only thrown for missing index if the work  
directory is cleaned out. Once the index is created though, it is  
found by each subsequent unit test run. Also, all documents I index  
are persisted across tests.

If I revert back to 0.10.0, missing index exception is thrown for  
count, index is created for each test, and no data is persisted across  
test. If I then switch to 0.11.0, no missing index exception is  
thrown for count and all data is persisted across tests.

Just want to make sure that this is expected. Thanks!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 30, 2010, 5:11am UTC](https://discuss.elastic.co/t/local-node-indexing-for-unit-testing-behaves-differently-in-0-11-0/3386/2 "2010-09-30T05:11:12Z")

</div>

The default gateway for 0.11 has changed to the local one, meaning that  
state + indices are retained across node restarts. You can configure  
elasticsearch with the "none" gateway to have the same behavior  
("gateway.type" set to "none").

On Thu, Sep 30, 2010 at 2:40 AM, dmcclure [duane.mcclure@gmail.com](mailto:duane.mcclure@gmail.com) wrote:

> I have a number of unit tests that utilize a local node. Each test  
> starts a node, checks for the existence of an index the unit test will  
> be working with and creates the index if it does not exist.
> 
> In 0.10.0, the same index would get created for each unit test  
> (exception would be thrown for a count against the index and I would  
> create the index). Any documents that I index are never persisted  
> across a given unit test.
> 
> In 0.11.0, exception is only thrown for missing index if the work  
> directory is cleaned out. Once the index is created though, it is  
> found by each subsequent unit test run. Also, all documents I index  
> are persisted across tests.
> 
> If I revert back to 0.10.0, missing index exception is thrown for  
> count, index is created for each test, and no data is persisted across  
> test. If I then switch to 0.11.0, no missing index exception is  
> thrown for count and all data is persisted across tests.
> 
> Just want to make sure that this is expected. Thanks!

---

<div class="post-metadata">

**Author:** ![dmcclure1](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@dmcclure1](https://discuss.elastic.co/u/dmcclure1)\
**Post date:** [September 30, 2010, 12:27pm UTC](https://discuss.elastic.co/t/local-node-indexing-for-unit-testing-behaves-differently-in-0-11-0/3386/3 "2010-09-30T12:27:17Z")

</div>

Yeah, even read that prior to post, just didn't want to sink in I  
guess... thank you!

On Sep 30, 1:11 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> The default gateway for 0.11 has changed to the local one, meaning that  
> state + indices are retained across node restarts. You can configure  
> elasticsearch with the "none" gateway to have the same behavior  
> ("gateway.type" set to "none").
> 
> On Thu, Sep 30, 2010 at 2:40 AM, dmcclure [duane.mccl...@gmail.com](mailto:duane.mccl...@gmail.com) wrote:
> 
> > I have a number of unit tests that utilize a local node. Each test  
> > starts a node, checks for the existence of an index the unit test will  
> > be working with and creates the index if it does not exist.
> 
> > In 0.10.0, the same index would get created for each unit test  
> > (exception would be thrown for a count against the index and I would  
> > create the index). Any documents that I index are never persisted  
> > across a given unit test.
> 
> > In 0.11.0, exception is only thrown for missing index if the work  
> > directory is cleaned out. Once the index is created though, it is  
> > found by each subsequent unit test run. Also, all documents I index  
> > are persisted across tests.
> 
> > If I revert back to 0.10.0, missing index exception is thrown for  
> > count, index is created for each test, and no data is persisted across  
> > test. If I then switch to 0.11.0, no missing index exception is  
> > thrown for count and all data is persisted across tests.
> 
> > Just want to make sure that this is expected. Thanks!

---

<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:** [July 6, 2017, 4:18am UTC](https://discuss.elastic.co/t/local-node-indexing-for-unit-testing-behaves-differently-in-0-11-0/3386/4 "2017-07-06T04:18:40Z")

</div>

Closed on July 6, 2017, 4:18am UTC


