Clear redis before every test #15

Merged
merged 4 commits into from Apr 29, 2012

Conversation

Projects
None yet
2 participants

Ran into some errors when trying to create new redis tests, a lot of inconsistent results. I believe the majority of it was due to not clearing redis before every test.

Sorry about not submitting separate pull requests. I can if you wish, but I also fixed a few other tiny errors. Thanks!

@igrigorik igrigorik and 1 other commented on an outdated diff Apr 28, 2012

spec/native_spec.rb
@@ -21,9 +21,20 @@
bf1.include?("test").should be_true
bf2.include?("test").should be_true
end
+
+ it "should store data in filter up to 10% of filter size" do
@igrigorik

igrigorik Apr 28, 2012

Owner

Why 10%, this seems like an arbitrary limit? You can push as much data as you want, you'll simply tradeoff against collisions.

@billywatson

billywatson Apr 28, 2012

Theoretically, you should have 0 collisions at this point.

@billywatson

billywatson Apr 28, 2012

And really, if this isn't a good test, that's fine. I was also trying to test the clearing of redis did something. If you ramp this up from 10%, then more than this test would fail if you didn't clear redis. So whatever you think is best.

@igrigorik

igrigorik Apr 28, 2012

Owner

There is no guarantee that there will be 0 collisions. Bloomfilters are probabilistic data structures.. It is highly unlikely that you will get a collision with your configuration, but it is possible -- which makes for some great heisen failures in your test suite. :)

Okay got rid of those tests :)

igrigorik merged commit 846a687 into igrigorik:master Apr 29, 2012

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