-
Notifications
You must be signed in to change notification settings - Fork 11
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
Refactor integration tests to improve legibility #11
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
e9f061b
to
f75c614
Compare
@davidbrochart @Zsailer Quick ping for visibility on this PR and #12. I'm working on writing more integration tests for this package, so I would like to see whether my "test style" is acceptable to the maintainers before proceeding further. |
Sorry for the late reply @dlqqq. |
@davidbrochart I don't think these tests will exhibit any flakiness. The strategy of pinging the other client and waiting for its reply via I think the remaining work is to add some more complex tests that may catch the data loss issues users are experiencing, which I'm working on.
I think with more development on the test fixtures (like the work done here in this PR), we can mitigate the complexity of using CRDTs in our tests. For example, the tests in this branch are quite readable now IMO. I'm not sure how one would test |
What I mean is that we could use a different strategy for client-server synchronization than what I did in |
I believe this would make tests more flaky, no? A computer cannot guarantee that an interprocess call will take less than XXX milliseconds. It seems better to explicitly wait for the other client to reply.
I haven't been able to reproduce that. I will do more testing however. What are the remaining steps needed to merge this PR? Is it just that these tests are flaky on your machine? |
Sure, it was just to show you what
I need to review it :) Tests are flaky in the CI too. |
@davidbrochart Thanks for clarifying! I feel like CRDT tests belong in the I just pushed another commit that fixes a small issue I noticed in the test teardown:
The server was not being closed in the test fixture during teardown (after the Now, running the test 100 times does not produce a single failure:
|
I don't think you get my point, I don't want to test dependencies. |
Yes, the tests require |
Summary
This PR refactors the
test_pycrdt_yjs.py
test file, along with the JS client test files, to be more legible.Detailed description
YTest => YClient
for clarityclock_run()
=>inc_clock()
async run_clock()
=>async wait_for_reply()
prettier
formatting to JS test filesclock
variable to determine whetherymap.clock
was incremented by self or by the Python client)