Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky MinHasherSpec test. Fixes #500 #514

Merged
merged 2 commits into from
Feb 26, 2016

Conversation

Gabriella439
Copy link
Contributor

One MinHasher32 being tested was using 247 hash functions internally, which
means that the expected absolute error bound:

1 / sqrt {# of hash functions} = 1 / sqrt 247  ~  0.064

The same test required an upper bound on the error of 0.05, which was below
the expected error bound, meaning that this test would give flaky results due to
occasionally exceeding the required error bound. This change increases the
upper bound on the error to 0.1 which should give enough headroom over the
expected error bound to reduce the number of random test failures.

One `MinHasher32` being tested was using 247 hash functions internally, which
means that the expected absolute error bound:

    1 / sqrt {# of hash functions} = 1 / sqrt 247  ~  0.064

The same test required an upper bound on the error of `0.05`, which was below
the expected error bound, meaning that this test would give flaky results due to
occasionally exceeding the required error bound.  This change increases the
upper bound on the error to 0.1 which should give enough headroom over the
expected error bound to reduce the number of random test failures.
@@ -56,7 +56,7 @@ class MinHasherSpec extends WordSpec with Matchers {
test(new MinHasher32(0.5, 1024), 0.5, 0.1)
}
"measure 0.8 similarity in 1024 bytes with < 0.05 error" in {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with < 0.1 error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! Fixed

@piyushnarang
Copy link
Collaborator

👍

johnynek added a commit that referenced this pull request Feb 26, 2016
@johnynek johnynek merged commit 7bcbc68 into develop Feb 26, 2016
@johnynek johnynek deleted the ggonzalez/fix_flaky_minhasherspec branch February 26, 2016 20:38
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.

3 participants