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 occasional Hypothesis test failure when calling get_or_create_collection #379

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

levand
Copy link
Contributor

@levand levand commented Apr 18, 2023

Description of changes

Hypothesis tests would occasionally fail when they stumbled on a scenario like the following:

state = CollectionStateMachine(api)
state.initialize()
v1 = state.create_coll(coll={"name": "A11", "metadata": {"foo": "bar"}})
state.get_or_create_coll(coll={"name": "A11", "metadata": None})
state.teardown()

This PR allows the tests to pass by not making the assertion in the special case of metadata=None.

This cannot be fixed in code, because we have already designed passing metadata=None to mean "do not update the metadata." As such, there is no way to explicitly set the metadata to None without making user-facing API changes, and so the tests should not try to do so.

Test plan

This fixes a failure in the existing tests.

Documentation Changes

N/A

@HammadB
Copy link
Collaborator

HammadB commented Apr 18, 2023

Can we add a TODO to change this API behavior in the future.

@levand
Copy link
Contributor Author

levand commented Apr 18, 2023

Can we add a TODO to change this API behavior in the future.

#380

@levand levand merged commit 29dff1a into team/hypothesis-tests Apr 19, 2023
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