Fixed error in testing where test cases was running before the dtabase was synced