Using Node.js I have two unit tests (mocha) using a single live CBv4 instance.
The 1st test inserts a document.
The 2nd test reads all documents.
In between test runs I flush the bucket I’m inserting and reading from.
The issue I’m seeing is both tests pass, but the read test returns zero documents - should be one document.
The read seems to complete before the insert is “commited” or something like that as there is one document in the bucket from the insert.
Does this seem like normal behavior?
I know NoSQL is eventually read consistent but I though on a single instance it would be just a few milli seconds or so.
My read is a simple N1QL query:
let query = N1qlQuery.fromString('select meta(rsm).id as doc_id, meta(rsm).cas, email, id from rsm WHERE type = "user"');
In my case if I add a 500ms timeout in the read test the test passes.
At this point in time I’m new to Couchbase so I’m not sure if this is typical server behaviour, but I was assuming eventually read consistent (using N1QL) would be a few milli seconds at most.