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 test_versions test #667

Closed
gsilvestrin opened this issue Mar 8, 2023 · 0 comments · Fixed by #668
Closed

Fix flaky test_versions test #667

gsilvestrin opened this issue Mar 8, 2023 · 0 comments · Fixed by #668

Comments

@gsilvestrin
Copy link
Contributor

test_versions in test_dataset.py is flaky. Sometime it fails with:

python/tests/test_dataset.py::test_versions FAILED                       [  9%]

=================================== FAILURES ===================================
________________________________ test_versions _________________________________

tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_versions0')

    def test_versions(tmp_path: Path):
        table1 = pa.Table.from_pylist([{"a": 1, "b": 2}, {"a": 10, "b": 20}])
        base_dir = tmp_path / "test"
        lance.write_dataset(table1, base_dir)
    
        assert len(lance.dataset(base_dir).versions()) == 1
    
        table2 = pa.Table.from_pylist([{"s": "one"}, {"s": "two"}])
        time.sleep(1)
        lance.write_dataset(table2, base_dir, mode="overwrite")
    
        assert len(lance.dataset(base_dir).versions()) == 2
    
        v2, v1 = lance.dataset(base_dir).versions()
        assert isinstance(v1["timestamp"], datetime)
        assert isinstance(v2["timestamp"], datetime)
>       assert v1["timestamp"] < v2["timestamp"]
E       assert datetime.datetime(2023, 3, 8, 19, 2, 50, 956316) < datetime.datetime(2023, 3, 8, 19, 2, 49, 947502)

python/tests/test_dataset.py:58: AssertionError
============================= slowest 30 durations =============================

Look into why this happens. It is possible that we need to add an explicit sort on version number before returning in Rust to return versions in ascending order.

@gsilvestrin gsilvestrin linked a pull request Mar 8, 2023 that will close this issue
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 a pull request may close this issue.

1 participant