Skip to content
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

Using gocql for integration unit test but failed intermittently #1742

Open
lstruman opened this issue Mar 3, 2024 · 3 comments
Open

Using gocql for integration unit test but failed intermittently #1742

lstruman opened this issue Mar 3, 2024 · 3 comments

Comments

@lstruman
Copy link

lstruman commented Mar 3, 2024

Please answer these questions before submitting your issue. Thanks!

What version of Cassandra are you using?

3.11.4

What version of Gocql are you using?

1.6.0

What version of Go are you using?

1.21

What did you do?

I wrote integration unit tests. I wrote data into the tables and read them back for comparison.

What did you expect to see?

I expected to see the same values

What did you see instead?

Sometime the data could not be read back (not connection error, my cassandra is localhost) and caused the test to fail. It usually worked if I reran the test suite, but not always. My test suite has 100+ test cases. Sometimes rerun did not pass and failed at diff test cases.


If you are having connectivity related issues please share the following additional information

Describe your Cassandra cluster

please provide the following information

  • output of nodetool status
  • output of SELECT peer, rpc_address FROM system.peers
  • rebuild your application with the gocql_debug tag and post the output
@martin-sucha
Copy link
Contributor

The issue description does not contain enough information to tell what the issue is. Have you tried rebuilding your application with gocql_debug or perhaps recording the faulty run with the RR debugger?

@lstruman
Copy link
Author

lstruman commented Mar 6, 2024

Thanks for the tips. I am not familiar with these tools, I will study and see if I can integrate with them. I don't know if these debug tools will generate much output. My problem happens not very often at my localhost, but more frequently in our Jenkins env. The worker node is a centos vm and the cassandra is also local to that node.

@lstruman
Copy link
Author

lstruman commented Mar 7, 2024

go test ./... -cover -count=1 -tags "cassandra gocql_debug"
...
2024/03/07 00:21:24 gocql: Session.handleNodeConnected: 127.0.0.1:9042
2024/03/07 00:21:24 gocql: conns of pool after stopped "127.0.0.1": 5
--- FAIL: TestStateUpdate2 (0.00s)

but it did not happen in the next try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants