I'm noticing my dynamodb tests are flaky because o...
# random
t
I'm noticing my dynamodb tests are flaky because of what I assume is eventual consistency. Eg a simple test that creates and entity and then reads it out fails randomly. How are other people thinking about this?
j
Are they repeatably/consistently flaky ? πŸ˜… If so you might want to try transactions against that same infrastructure just to check (changing only one variable in the experiment).
t
I guess I just should be using returnValues instead of requerying
j
If you'e testing writes, why not.
f
Using strong consistency flag on read might also help.
t
weirdly the strong consistency flag didn't fix it but need to test further
r
Wouldn't you need to use a transaction to guarantee it'd be immediately readable after the write?
f
hmm i might be wrong.. this is what I gather from the doc
A strongly consistent read in Amazon DynamoDB returns a result that reflects all writes that received a successful response prior to the read.
And it’s been pretty stable in my experience without using transaction.
l
I use return values instead of requerying on a put to a dynamo table. For gets, I run a script to seed the tables so they have data for reads.
t
^ this is exactly what I setup πŸ‘πŸ½