balderdashy / waterline-adapter-tests

API integration tests for Waterline adapters
MIT License
16 stars 41 forks source link

Likely race condition in autoincrement test #96

Closed devinivy closed 8 years ago

devinivy commented 8 years ago

This failed twice then finally passed over in PR https://github.com/balderdashy/sails-postgresql/pull/215 for sails-postgresql. Worth noting that the record that "already exists" was 4 in one failure and 5 in the other.

1) autoIncrement attribute feature should auto generate unique values even when values have been set:
     [Error (E_VALIDATION) 1 attribute is invalid] Invalid attributes sent to undefined:
 • id
   • A record with that `id` already exists (`4`).
  Error (E_VALIDATION) :: 1 attribute is invalid
  Error (E_VALIDATION) :: 1 attribute is invalid
  error: duplicate key value violates unique constraint "autoIncTable_pkey"
      at Socket.<anonymous> (_stream_readable.js:765:14)
      at emitReadable_ (_stream_readable.js:427:10)
      at emitReadable (_stream_readable.js:423:5)
      at readableAddChunk (_stream_readable.js:166:9)
      at Socket.Readable.push (_stream_readable.js:128:10)
      at TCP.onread (net.js:529:21)
particlebanana commented 8 years ago

Commented in https://github.com/balderdashy/waterline-adapter-tests/pull/99 and added a skip to that test. I can't imagine that test is correct.