you have a big race condition here- readonly indexed db calls run in parallel so there is no guarantee that all your assertions are done here. The safe bet is to use a idb transaction then wait for that transaction's complete/error events to fire.