-
Notifications
You must be signed in to change notification settings - Fork 84
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
Pytest test_datetime_serialization_speed
occasionally fails
#1145
Comments
A possible fix for datajoint#1145.
I don't think the execution time is the right thing to test since it's not deterministic. The test should verify correctness and validity. Should we remove the time-based tests? What are the best practices? |
This is not a bug since this is only an inadequate test. |
I say we loosen the testing constraints (I think you already did this on |
I would remove this test altogether. The tests should be for correctness and not for timing since it cannot be guaranteed. |
Bug Report
Description
The pytest
tests/test_blob.py::test_datetime_serialization_speed
fails non-deterministically.Reproducibility
Include:
local-docker
(docker://datajoint/mysql:8.0
)0.14.1
commit 03db252Steps to Reproduce
In a terminal window in the VSCode DevContainer on
dev-tests
branch (03db252), issuefor i in {1..10}; do pytest tests/test_blob.py::test_datetime_serialization_speed; done
to run the test 10 times. On my laptop, the test fails once out of 10 times. Since this issue seems hardware-dependent, it might be impossible to reproduce on some systems.Error Stack
Console Logs
Expected Behavior
The pytest
tests/test_blob.py::test_datetime_serialization_speed
passes every time without failing, regardless of hardware.Screenshots
N/A
Additional Research and Context
This test fails often (~10% of invocations) when it is run on my laptop (2017 ThinkPad X1 Carbon) in a DevContainer. The test fails very infrequently (~1% of invocations) when run in CI; one example is on this CI run in #1133. I suspect that a slow or busy CPU causes packing of
np.datetime64
arrays to happen unexpectedly slowly:https://github.com/ethho/datajoint-python/blob/e755b9763d950137718fb8447967ceef5172f57d/tests/test_blob.py#L218-L223
Additional Context
As of 12/18/2023, this test doesn't exist on branch
master
. This issue was discovered during development of #1142.The text was updated successfully, but these errors were encountered: