ckdake / setler

Setler lets you use the 'Feature Flags' pattern or add settings to models in Rails
MIT License
84 stars 21 forks source link

test_multithreaded_create test in test/settings_test.rb is failing locally but not on TravisCI #40

Closed jasnow closed 8 years ago

jasnow commented 8 years ago

test_multithreaded_create test in test/settings_test.rb is failing on my system (Ubuntu 14.04) but not on Travis. This is the error message:

SettingsTest#test_multithreaded_create [.../Projects/setler/test/settings_test.rb:83]:
[ActiveRecord::RecordNotUnique] exception expected, not
Class: <ActiveRecord::StatementInvalid>
Message: <"SQLite3::ConstraintException: UNIQUE constraint failed:
settings.var: INSERT INTO \"settings\" (\"created_at\", \"thing_id\",
\"thing_type\", \"updated_at\", \"value\", \"var\") VALUES (?, ?, ?, ?, ?, ?)">
---Backtrace---

Unclear how to fix it, but wanted to document it. Running the same code as @ckdake's master

jasnow commented 8 years ago

Appears to be related to the recent commit: https://github.com/tsubery/setler/commit/32c8c6c7c0938f2636d64e8abfe79cad4c326650

ckdake commented 8 years ago

Definitely related to that commit. This may be one of those SQLite -vs- real db things. @tsubery want to try figuring this one out?

tsubery commented 8 years ago

I think this test is just a false negative. What version of activerecord are you using?

jasnow commented 8 years ago

My steps:

What version of activerecord are you using?

Here is the subcommand from "appraisal rake test" command to see the error:

tsubery commented 8 years ago

Thanks. I fixed the test and this time ran the whole test matrix with appraisal. Here's the pr https://github.com/ckdake/setler/pull/41

jasnow commented 8 years ago

41 fixed it.