Skip to content

fixing races in 2 test cases#610

Open
sanji-programmer wants to merge 1 commit intolouischatriot:masterfrom
sanji-programmer:master
Open

fixing races in 2 test cases#610
sanji-programmer wants to merge 1 commit intolouischatriot:masterfrom
sanji-programmer:master

Conversation

@sanji-programmer
Copy link

Hi,

I noticed the both test cases failed sometimes (see below). After some investigation, I noticed that the function ensureIndex is not sync (as stated in the comment) and some operations may races with the assertions. The changes seemed to solve the race as I ran the test cases several times with no error.

1) Database
       Using indexes
         ensureIndex and index initialization in database loading
           ensureIndex can be called before a loadDatabase and still be initialized and filled correctly:

      Uncaught AssertionError: expected 0 to equal 3
      + expected - actual

      -0
      +3
  1 failing

  1) Database
       Using indexes
         ensureIndex and index initialization in database loading
           If a unique constraint is not respected, database loading will not work and no data will be inserted:
     Uncaught TypeError: Cannot read property 'should' of undefined

I posted a issue #609 to update the documentation of the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant