Skip to content

Fix tests in test_item.py etc #66

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

Merged
merged 29 commits into from
Mar 20, 2022
Merged

Fix tests in test_item.py etc #66

merged 29 commits into from
Mar 20, 2022

Conversation

jonhealy1
Copy link
Collaborator

@jonhealy1 jonhealy1 commented Mar 19, 2022

Related Issue(s):

Description:

Fix tests that should be working in test_item.py

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the changelog

@jonhealy1 jonhealy1 changed the title Fix some tests Fix tests in test-items.py Mar 19, 2022
@jonhealy1 jonhealy1 changed the title Fix tests in test-items.py Fix tests in test_item.py Mar 19, 2022
@jonhealy1 jonhealy1 marked this pull request as ready for review March 19, 2022 21:43
@jonhealy1 jonhealy1 requested a review from philvarner March 19, 2022 21:43
@jonhealy1
Copy link
Collaborator Author

A lot of warnings

73 passed, 19 skipped, 273 warnings in 66.25s (0:01:06)

@jonhealy1 jonhealy1 changed the title Fix tests in test_item.py Fix tests in test_item.py etc Mar 20, 2022
@philvarner
Copy link
Collaborator

I'm fine with merging this, but I think the need for the sleeps are a symptom of something else. My understanding with ES is that a client connected to the same node in a cluster (and in this case, we have a cluster of 1 node) is supposed to be able to insert/update an item and then retrieve the same item, so the fact that we're writing then having to wait to read seems like we're not writing correctly. I'll look into this in the next few days.

Another thing that would help is having a consistent setup/teardown -- a lot of these tests are running the same setup and teardown, so it's a lot of duplicated code.

@jonhealy1
Copy link
Collaborator Author

@philvarner True - maybe we aren't writing to the db correctly. I think I added delete statements in so many tests because so many tests were failing before saying this or that item already exists - I am going to try taking them out and see what happens now.

@jonhealy1
Copy link
Collaborator Author

The tests are inconsistent after deleting the delete statements - the tests will pass and then the next time a test will fail and the next time a few tests will fail then they will pass again - maybe there's a delay between sending the delete command and when the item is fully deleted?

@jonhealy1 jonhealy1 merged commit ba7409c into main Mar 20, 2022
@jonhealy1 jonhealy1 deleted the fix_tests branch March 21, 2022 19:36
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.

2 participants