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 test that made no sense #1172

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Fix test that made no sense #1172

merged 3 commits into from
Nov 27, 2024

Conversation

graebm
Copy link
Contributor

@graebm graebm commented Nov 26, 2024

Issue
While reviewing PR #1170 (comment) (which fixed an invalid index warning in this test), I gave this test a good hard look, and realized it was broken. As I slowly made sense of this test, I found another way it was broken.

Research:
This hash table test was added with the original hash table PR #17.

That branch had 2 different authors, which seems to have led to the brokenness

  • Original commit with this test
  • In this commit, author B accidentally replaces floating-point-rand with integer-rand, breaking randomness so this test doesn't actually test anything anymore
  • In this commit, Author A removes some entries[i -1] checks that don't really make sense because entries isn't sorted
  • In this commit, Author B brings the checks back. My guess is there was a merge conflict and they just accepted their own side

Description of changes

  • Fix randomness
  • Add comments about what this test is doing
  • Fix the checks, using the sorted_entries array instead of the unsorted entries array

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.63%. Comparing base (da9e1c3) to head (1c1f929).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1172   +/-   ##
=======================================
  Coverage   83.63%   83.63%           
=======================================
  Files          57       57           
  Lines        5953     5953           
=======================================
  Hits         4979     4979           
  Misses        974      974           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@graebm graebm enabled auto-merge (squash) November 26, 2024 23:39
@graebm graebm merged commit be8ed87 into main Nov 27, 2024
56 checks passed
@graebm graebm deleted the wut-this-test branch November 27, 2024 00:00
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