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

Cassandra reuseContainer fails if the container was already created before (and has a keyspace) #1376

Open
Aschraf opened this issue Jul 4, 2023 · 0 comments
Labels

Comments

@Aschraf
Copy link

Aschraf commented Jul 4, 2023

Describe the bug
In case the container is already running (from a previous test), and the keyspace already present, this init fails

The following script is used to initialize Cassandra keyspace:

https://github.com/PlaytikaOSS/testcontainers-spring-boot/blob/develop/embedded-cassandra/src/main/resources/cassandra-init.sql.template

Expected behavior
The keyspace should not be recreated if it already exists. The following could be used:

CREATE KEYSPACE IF NOT EXISTS {{keyspaceName}} WITH REPLICATION = { 'class':'SimpleStrategy', 'replication_factor' : {{replicationFactor}} }

Enviroment (please complete the following information):

  • OS name : [e.g. MacOS]
  • Docker Version: [e.g. 20.10.24]

Module:

  • Module Name: emdedded-cassandra
  • Module Version: 3.0.0-RC8

Additional context
A workaround is to add a new cassandra-init.sql.template as part of the tests with the script mentioned before.

@Aschraf Aschraf added the bug label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant