scylla-rust-driver icon indicating copy to clipboard operation
scylla-rust-driver copied to clipboard

tests: introducing keep-alive tests

Open fruch opened this issue 9 months ago • 4 comments

introducing test that validates the keep-alive behavier

those tests are based on: com.datastax.oss.driver.core.heartbeat.HeartbeatIT

Pre-review checklist

  • [ ] I have split my patch into logically separate commits.
  • [ ] All commit messages clearly explain what they change and why.
  • [ ] I added relevant tests for new features and bug fixes.
  • [ ] All commits compile, pass static checks and pass test.
  • [ ] PR description sums up the changes and reasons why they should be introduced.
  • [ ] I have provided docstrings for the public items that I want to introduce.
  • [ ] I have adjusted the documentation in ./docs/source/.
  • [ ] I added appropriate Fixes: annotations to PR description.

fruch avatar Feb 13 '25 15:02 fruch

test seems to be failing in CI, when working locally... I have zero clue, as for why...

fruch avatar Feb 13 '25 15:02 fruch

cargo semver-checks found no API-breaking changes in this PR! 🎉🥳 Checked commit: b6fde9924c22d35a9211eb898d427d89c1881e40

github-actions[bot] avatar Feb 13 '25 15:02 github-actions[bot]

test seems to be failing in CI, when working locally... I have zero clue, as for why...

How are you running the tests? I checkout out this PR and run make ccm-test, and got the same failures as in "CCM tests" CI workflow.

I started to look into "should_not_send_heartbeat_during_protocol_initialization", and I don't understand why it fails. The session fails because of connection broken when sending Options request - as expected. So then why we see no feedback of this request on the channel? @wprzytula please help here.

Lorak-mmk avatar Feb 13 '25 23:02 Lorak-mmk

test seems to be failing in CI, when working locally... I have zero clue, as for why...

How are you running the tests? I checkout out this PR and run make ccm-test, and got the same failures as in "CCM tests" CI workflow.

I started to look into "should_not_send_heartbeat_during_protocol_initialization", and I don't understand why it fails. The session fails because of connection broken when sending Options request - as expected. So then why we see no feedback of this request on the channel? @wprzytula please help here.

The reason is very simple (yet not so easy to spot). These tests are placed under ccm_integration. make ccm-test does not set SCYLLA_URI<X> env variables. Because of that, the default addresses (127.0.0.1-3) are used (see the details in test_with_3_node_cluster. If I run:

SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 RUSTFLAGS="--cfg ccm_tests" RUST_LOG=trace cargo test --test ccm_integration

all tests are passing.

These tests should be moved to integration - we do not use ccm in these tests (at least in the tests that are already implemented).

muzarski avatar Feb 16 '25 20:02 muzarski

Closing - this PR is in initial stages, and it will probably be easier for us to write such tests from scratch instead of starting from this PR.

Lorak-mmk avatar Sep 22 '25 15:09 Lorak-mmk