Improve the robustness of unit cases #4564
Closed
stayrascal
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to learning Daft start with running the unit test cases via
make test, but there are a re unit cases failed in my environemnt, I think we can improve them a little bit.Running Environment
Mac M1 and Debian 5.4.143(CI Agent).
Problems
make testworks well in my mac, but some cases failed in my ci agent.1. test_url_upload_local.py::test_upload_local_no_write_permissions
The failed reason is that I use
rootuser to running test, so the user should have full permission on any path, which is not meet the purpose of test_upload_local_no_write_permissions.Suggestion: it's better skip this test when run as root user?

2. test_numeric.py::test_table_numeric_trigonometry
The problem i meet is the precision of float.

Suggestion: using
pytest.approxduring comparing x and y?3. test_s3_credentials_refresh.py::test_s3_credentials_refresh
There are some small problem on this test case.
it's better to use
aws_server,aws_server_ip,aws_server_port,aws_credentialspytest fixtures from conftest (move the aws fixtures from delta_lake conftest.py to io conftest.py) instead of re-preparing the configuratios and start moto server, which might not been stopped if something failed.The purpose of this test case is refresh the credential if it's expired (1s in this case), the

read_parquet(read schema),df.collect(read content) andwrite_parquetcan share same credential within active window, but it's hard to decide how long it will take in different workload, e.g. the write_parquet maybe take 2 or more seconds, which the credential might be refreshed mutilple times, so it's hard to assert the value ofcount_get_credentialsThe is a trick thing that the
start_service("moto_server")will launch two process in my ci agent, but thestop_process(process)only stop one process, the mote_server still running after test case finished. So If i rerun the test, the test bucket already exists.Suggestion:
Beta Was this translation helpful? Give feedback.
All reactions