Saving and getting object from Raptor

Jan 25 at 3:41 PM
I'm using this library for a project.
While unit testing, I noticed random failure in fetching data.

I have a Class that instances raptors, and function that internally calls raptor function.

The test is something like:
  1. Create an object
  2. Save this object
  3. Retrieve back the object
This test random fails at (3), always while I run all my tests (~40).
Raptor Query function result OK is true but Count is 0. Point (2) raptor result in saving is also true.

Looking for a solution to the issue, I put a Thread.Sleep() of 1 millisecond. The problem seems resolved.

Am I missing something?
Could it be somthing I wrote wrong in the code to save or fetch the object?
Jan 27 at 3:51 PM
It sounds like you may have background indexing enabled in your view. Try setting this to false.
Marked as answer by ChiaraDeA on 1/30/2017 at 7:16 AM
Jan 30 at 2:17 PM
Thanks! It was exactly that.

Re-runned all tests with success :)