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

Integration Test Failing due to Unordered List #654

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

czaloom
Copy link
Collaborator

@czaloom czaloom commented Jul 3, 2024

Reproducible Example

`integration_tests/client/datasets/test_dataset.py::test_create_tabular_dataset_and_add_groundtruth`

Issue Description

The test queries from postgres and treats the response as an ordered list which it is not.

Test failure is dependent on what order postgres returns its response.

Expected Behavior

The test should not assume an ordered response from postgres.

@czaloom czaloom linked an issue Jul 3, 2024 that may be closed by this pull request
1 task
@czaloom czaloom marked this pull request as ready for review July 3, 2024 18:40
@czaloom czaloom requested review from ntlind and ekorman as code owners July 3, 2024 18:40
metadata_links = data[0].meta
assert len(metadata_links) == 1
assert "metadatum1" in metadata_links
assert metadata_links["metadatum1"] == "temporary"
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add back this assertion to make sure this change equivalent to the old test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The value isnt defined in the test so im not sure why this is necessary. The assertion is handled by datum.meta == md1 or datum.meta == md2

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is no regression in test coverage so im confused why this matters.

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense!

metadata_links = data[1].meta
assert len(metadata_links) == 2
assert "metadatum2" in metadata_links
assert metadata_links["metadatum2"] == "a string"
Copy link
Contributor

Choose a reason for hiding this comment

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

same with this line and 285

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see above.

@czaloom czaloom merged commit ec243d8 into main Jul 3, 2024
11 checks passed
@czaloom czaloom deleted the 653-bug-integration-test-fails-randomly branch July 3, 2024 18:52
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.

BUG: Integration Test Fails Randomly
2 participants