Skip to content

Commit

Permalink
Adding sleeps to make up for [in]consistent_read
Browse files Browse the repository at this point in the history
  • Loading branch information
celeduc committed Jan 17, 2012
1 parent e296813 commit 103e4bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions failing_tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Finished tests in 721.371086s, 0.0943 tests/s, 3.1828 assertions/s.
Finished tests in 557.620890s, 0.1219 tests/s, 4.1211 assertions/s.

1) Failure:
test_clobs(TestLobs) [/home/ubuntu/src/simple_record/test/test_lobs.rb:45]:
Expand All @@ -9,16 +9,13 @@ test_single_clob(TestLobs) [/home/ubuntu/src/simple_record/test/test_lobs.rb:87]
puts is 1, should be 0.

3) Failure:
test_count(TestSimpleRecord) [/home/ubuntu/src/simple_record/test/test_simple_record.rb:295]:
Failed assertion, no message given.

4) Failure:
test_dirty(TestSimpleRecord) [/home/ubuntu/src/simple_record/test/test_simple_record.rb:204]:
<0> expected but was
<1>.

5) Failure:
4) Failure:
test_first_validations(TestValidations) [/home/ubuntu/src/simple_record/test/test_validations.rb:51]:
#<ActiveModel::Errors:0x89e129c @base=#<MyModel:0x85f0c14 @errors=#<ActiveModel::Errors:0x89e129c ...>, @dirty={"save_count"=>nil}, @attributes={"name"=>["abcd"], "save_count"=>"09223372036854775809", "id"=>"c452f094-4121-11e1-91b0-080027c736d0", "created"=>["2012-01-17T15:41:48"], "updated"=>["2012-01-17T15:41:48"], "nickname"=>["abcd"]}, @attributes_rb={"name"=>"abcd", "created"=>Tue, 17 Jan 2012 15:41:48 +0000, "updated"=>Tue, 17 Jan 2012 15:41:48 +0000, "nickname"=>"abcd"}, @lobs={}, @new_record=false, @validation_context=nil, @attr_before_save=true, @attr_before_create=true, @attr_after_create=true, @attr_after_save=true>, @messages={:name=>["must be unique."]}>
#<ActiveModel::Errors:0xa89af1c @base=#<MyModel:0xa86eda4 @errors=#<ActiveModel::Errors:0xa89af1c ...>, @dirty={"save_count"=>nil}, @attributes={"name"=>["abcd"], "save_count"=>"09223372036854775809", "id"=>"7b17220c-4125-11e1-b9c7-080027c736d0", "created"=>["2012-01-17T16:08:23"], "updated"=>["2012-01-17T16:08:23"], "nickname"=>["abcd"]}, @attributes_rb={"name"=>"abcd", "created"=>Tue, 17 Jan 2012 16:08:23 +0000, "updated"=>Tue, 17 Jan 2012 16:08:23 +0000, "nickname"=>"abcd"}, @lobs={}, @new_record=false, @validation_context=nil, @attr_before_save=true, @attr_before_create=true, @attr_after_create=true, @attr_after_save=true>, @messages={:name=>["must be unique."]}>

68 tests, 2298 assertions, 4 failures, 0 errors, 0 skips

68 tests, 2296 assertions, 5 failures, 0 errors, 0 skips
3 changes: 2 additions & 1 deletion test/test_simple_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_save_get
# test nilification
mm2.age = nil
mm2.save
sleep(1) # not sure why this might work...
sleep(2) # not sure why this might work... not respecting consistent_read?
mm2 = MyModel.find(id,:consistent_read=>true)
assert mm2.age.nil?, "doh, age should be nil, but it's " + mm2.age.inspect
end
Expand Down Expand Up @@ -365,6 +365,7 @@ def test_nil_attr_deletion
# Should be NIL
assert_equal mm.age, nil

sleep 1 #doesn't seem to be respecting consistent_read below
# Should have NO age attributes
assert_equal @@sdb.get_attributes('simplerecord_tests_my_models', mm.id, 'age',true)[:attributes].size, 0
end
Expand Down

0 comments on commit 103e4bf

Please sign in to comment.