-
Couldn't load subscription status.
- Fork 13
Implement timestamp generators and enable 4 out of 5 TimestampTests #295
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, that was not supposed to be an approve
|
Rebased on |
|
v1.1: Addressed comments - most importantly fixed a bug where we would compare |
Things to pay attention to during review: - warning threshold is passed in microseconds, while warning interval is passed in millis - documentation says that if threshold is <= 0, it should disable the warnings - documentation says that if interval is <= 0, it should fallback to 1ms interval
I was really curious why these methods were not defined in `testing_unimplemented`. The testing binary linking should fail. Well... I found out that they are defined in src/, where we still have a cpp implementation of the timestamp generators. Note: While having both cpp and rust implementations, the linker did not complain, and happily linked the test binary even though there are duplicate definitions of timestamp_gen methods. It seems that linker picked up the cpp implementations. Why? The test causes segfault when calling `cass_cluster_set_timestamp_gen` when we try to clone an Arc. It means that pointer `cass_timestamp_gen_server_side_new` does not originate from Arc allocation - this suggests that the origin of the pointer is different (created by cpp API).
The remaining test (MonotonicTimestampGenerator) needs further adjustments. Currently it segfaults - I'll create a separate issue for this one. TLDR - currently, the generator provided to `cass_cluster_set_timestamp_gen` is constructed using pure c++ API (no API from cassandra.h is used). It depends on `src/timestamp_generator.cpp`, which we should ultimately remove. However, to remove this file, we need to implement a testing utility which allows us to read the generated timestamps during the test. The test would then need to be rewritten using this new utility.
|
v1.3: Forgot to cover |
Fixes: #46
Ref: #132
This PR implements timestamp methods.
Enabled integration
TimestampTestsStatementBatchStatementServerSideTimestampGeneratorStatementServerSideTimestampGeneratorBatchStatementDisabled integration test
There is one test that we need to keep disabled (for now). I want to create a separate issue for this. issue: #296.
Pre-review checklist
[ ] I have implemented Rust unit tests for the features/changes introduced..github/workflows/build.ymlingtest_filter..github/workflows/cassandra.ymlingtest_filter.