ribaraka commented on code in PR #1780:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1780#discussion_r1766838939


##########
main_test.go:
##########
@@ -0,0 +1,145 @@
+//go:build cassandra || integration
+// +build cassandra integration
+
+package gocql
+
+import (
+       "context"
+       "flag"
+       "fmt"
+       "log"
+       "os"
+       "strconv"
+       "testing"
+       "time"
+
+       "github.com/testcontainers/testcontainers-go"
+       "github.com/testcontainers/testcontainers-go/wait"
+)
+
+func TestMain(m *testing.M) {
+       ctx := context.Background()
+
+       flag.Parse()
+
+       cassandraVersion := flagCassVersion.String()[1:]
+
+       jvmOpts := "-Dcassandra.test.fail_writes_ks=test 
-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
+       if *clusterSize == 1 {
+               // speeds up the creation of a single-node cluster.
+               jvmOpts += " -Dcassandra.initial_token=0 
-Dcassandra.skip_wait_for_gossip_to_settle=0"
+       }
+
+       env := map[string]string{
+               "JVM_OPTS":                  jvmOpts,
+               "CASSANDRA_SEEDS":           "cassandra1",
+               "CASSANDRA_DC":              "datacenter1",
+               "HEAP_NEWSIZE":              "100M",
+               "MAX_HEAP_SIZE":             "256M",
+               "CASSANDRA_RACK":            "rack1",
+               "CASSANDRA_ENDPOINT_SNITCH": "GossipingPropertyFileSnitch",
+               "CASS_VERSION":              cassandraVersion,
+       }
+
+       if *flagRunAuthTest {
+               env["AUTH_TEST"] = "true"
+       }
+
+       networkRequest := testcontainers.GenericNetworkRequest{
+               NetworkRequest: testcontainers.NetworkRequest{
+                       Name: "cassandra",
+               },
+       }
+       cassandraNetwork, err := testcontainers.GenericNetwork(ctx, 
networkRequest)

Review Comment:
   A commit fixing the flaky tests has already been pushed, and all integration 
replacements have been completed. Please take a look



-- 
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