worryg0d commented on code in PR #1929:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1929#discussion_r2932559549


##########
cassandra_test.go:
##########
@@ -4397,3 +4405,28 @@ func TestHostInfoFromIter(t *testing.T) {
                t.Errorf("unexpected non-missing rack")
        }
 }
+
+type mockSessionReadyListener struct {
+       readyCount int
+}
+
+func (l *mockSessionReadyListener) OnSessionReady() {
+       l.readyCount++
+}
+
+func TestSessionReadyEvent(t *testing.T) {
+       listener := &mockSessionReadyListener{}
+
+       // Don't use createSession helper because it creates session twice,
+       // once for creating test keyspace and once for the session itself
+       cluster := createCluster()
+       cluster.Metadata.SessionReadyListener = listener
+       session, err := cluster.CreateSession()
+       require.NoError(t, err)
+       defer session.Close()
+
+       require.Eventually(t, func() bool {
+               require.Equal(t, 1, listener.readyCount)

Review Comment:
   You're right. I was using it to track listener issue for better log info, 
but missed that it affects retries. Changed this and moved require.equal call 
after just to be sure



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to