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

Integration test fixes and ttl/writetime auto flag default changes to false #235

Closed

Conversation

arvy
Copy link
Contributor

@arvy arvy commented Dec 15, 2023

In two places in environment.sh we do a check to see if a container is up and running, but we user docker ps -a, which lists all containers (if those that are not running). I encountered this issue while trying to run the integration tests locally:

++ _testDockerCDM_Directory
++ docker exec cdm-sit-cdm ls /local/cassandra-data-migrator.jar
++ rtn=1
++ '[' 1 -eq 0 ']'
++ echo no
+ '[' no '!=' yes ']'
+ _createDockerCDM_Directory
+ docker exec cdm-sit-cdm mkdir -p /local
Error response from daemon: Container 2ba95ecae35c69594c57fdfe41d872df4b1dac98a73cded529c47087c6617466 is not running
make: *** [env_setup] Error 1

Checklist:

  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@arvy arvy requested a review from a team as a code owner December 15, 2023 01:30
@arvy arvy force-pushed the fixes-container-check-in-integrationtests branch from e4ed804 to f57479f Compare December 15, 2023 09:51
@arvy arvy changed the title Fixes container check in integration tests. Integration test fixes and ttl/writetime auto flag default changes to false Dec 15, 2023
_info "Moving ${testDir}/output/$(basename ${testDir})/*.err TO ${testDir}/output"
mv ${testDir}/output/$(basename ${testDir})/*.err ${testDir}/output
docker cp ${DOCKER_CDM}:/${testDir} ${testDir}/output/
_info "Moving ${testDir}/output/$(basename ${testDir})/output/*.out TO ${testDir}/output"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_info "Moving ${testDir}/output/$(basename ${testDir})/output/*.out TO ${testDir}/output"
_info "Moving ${testDir}/output/$(basename ${testDir})/output/*.out TO ${testDir}/output/"

@@ -85,10 +85,10 @@ public enum PropertyType {
required.add(ORIGIN_KEYSPACE_TABLE);
types.put(ORIGIN_TTL_NAMES, PropertyType.STRING_LIST);
types.put(ORIGIN_TTL_AUTO, PropertyType.BOOLEAN);
defaults.put(ORIGIN_TTL_AUTO, "true");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, does these changes fixes any integration tests?

@@ -81,7 +81,7 @@ _testDockerNetwork() {
}

_testDockerCassandra() {
dockerPs=$(docker ps -a | awk '{if ($NF == "'${DOCKER_CASS}'") {print "yes"}}')
dockerPs=$(docker ps | awk '{if ($NF == "'${DOCKER_CASS}'") {print "yes"}}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now with this change in place, I'm running into this error,

INFO Starting Docker container cdm-sit-cass
docker: Error response from daemon: Conflict. The container name "/cdm-sit-cass" is already in use by container "37ef23ba475bc76e1e80fec2b8c80edbc336a5c1149261912fbfd2571f1b0ad0". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.

Could you please showcase how you originally encountered the error that you have in the PR description and provide reproduction steps? TY!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try this - kill your ITs in the middle of the run after the docker containers come up and then restart your docker engine. This will stop the running containers, but they will remain there and continue to get returned in the docker ps -a output.

@@ -81,7 +81,7 @@ _testDockerNetwork() {
}

_testDockerCassandra() {
dockerPs=$(docker ps -a | awk '{if ($NF == "'${DOCKER_CASS}'") {print "yes"}}')
dockerPs=$(docker ps | awk '{if ($NF == "'${DOCKER_CASS}'") {print "yes"}}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now with this change in place, I'm running into this error,

INFO Starting Docker container cdm-sit-cass
docker: Error response from daemon: Conflict. The container name "/cdm-sit-cass" is already in use by container "37ef23ba475bc76e1e80fec2b8c80edbc336a5c1149261912fbfd2571f1b0ad0". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.

Could you please showcase how you originally encountered the error that you have in the PR description and provide reproduction steps? TY!

mv ${testDir}/output/$(basename ${testDir})/*.err ${testDir}/output
docker cp ${DOCKER_CDM}:/${testDir} ${testDir}/output/
_info "Moving ${testDir}/output/$(basename ${testDir})/output/*.out TO ${testDir}/output"
mv ${testDir}/output/$(basename ${testDir})/output/*.out ${testDir}/output/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line for example is resolving as,

INFO Moving smoke/05_reserved_keyword/output/05_reserved_keyword/*.err TO smoke/05_reserved_keyword/output

where, smoke/05_reserved_keyword/output/05_reserved_keyword directory doesn't exist today

@arvy
Copy link
Contributor Author

arvy commented Dec 15, 2023

Since the auto flag is now influencing whether the feature is enabled, I flipped the default value to false, since one of the ITs was failing with a validation error, expecting the feature to be disabled. @mieslep sais default should be true.. ..i'll revert that change and figure out how to deal with the failing IT..

types.put(ORIGIN_WRITETIME_NAMES, PropertyType.STRING_LIST);
types.put(ORIGIN_WRITETIME_AUTO, PropertyType.BOOLEAN);
defaults.put(ORIGIN_WRITETIME_AUTO, "true");
defaults.put(ORIGIN_WRITETIME_AUTO, "false");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arvy I believe you may be right here. For example, if we have a counter table, then we receive the following when it is turned on,

2023-12-15 15:45:31 ERROR [] WritetimeTTL:117 - Counter table cannot specify TTL or WriteTimestamp columns as they cannot set on write
2023-12-15 15:45:31 ERROR [] CopyJobSession:80 - Feature com.datastax.cdm.feature.WritetimeTTL is not valid.  Please check the configuration.

@msmygit
Copy link
Collaborator

msmygit commented Dec 18, 2023

Marking this PR as closed as the main is now back to stable. Thank you!

@msmygit msmygit closed this Dec 18, 2023
@msmygit
Copy link
Collaborator

msmygit commented Dec 19, 2023

@all-contributors please add @arvy for userTesting doc

Copy link
Contributor

@msmygit

I've put up a pull request to add @arvy! 🎉

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

Successfully merging this pull request may close these issues.

3 participants