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
Fix upgrade_through_versions_test.py::TestUpgrade* tests #228
Conversation
Run generated upgrade_through_versions_test on pytest >7.2.0 pytest-7.2.0 changed how markers were inherited, pytest-dev/pytest#7792 Remove how internode_ssl was changing seeds to append the ssl storage port, it's not needed as the tests always already set enable_legacy_ssl_storage_port to true. patch by Mick Semb Wever; reviewed by Brandon Williams for CASSANDRA-18499
… on the current jdk"
@@ -325,6 +326,8 @@ def fixture_add_additional_log_patterns(self, fixture_dtest_setup): | |||
) | |||
|
|||
def prepare(self): | |||
if type(self).__name__ == "TestUpgrade": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change
|
||
def current_env_java_version(): | ||
java_command = os.path.join(os.environ['JAVA_HOME'], 'bin', 'java') | ||
output = subprocess.check_output([java_command, '-version'], stderr=subprocess.STDOUT).decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already implemented:
from ccmlib.common import get_jdk_version_int
return get_jdk_version_int(java_command)
|
||
|
||
def current_env_java_version(): | ||
java_command = os.path.join(os.environ['JAVA_HOME'], 'bin', 'java') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fail somewhere with a clear message when JAVA_HOME
is not defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed, see update.
# replace matching meta with current version | ||
for idx, meta in enumerate(metas): | ||
if meta.matches_current_env_version_family: | ||
java_version = current_env_java_version() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should get that java version once and do not do that in every iteration in a loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should only called once, i was missing a break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also make sure to skip the entire test if say we run with j17 and the upgrade path ends up with a single version
27f7af5
to
fcd0294
Compare
create_upgrade_class(upgrade.name, [m for m in metas], protocol_version=upgrade.protocol_version, extra_config=upgrade.extra_config) | ||
else: | ||
# even for RUN_STATIC_UPGRADE_MATRIX we only test upgrade paths jdk compatible with the end "indev_" version (or any JAVA<jdk_version>_HOME defined) | ||
metas = jdk_compatible_steps(upgrade.version_metas) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are still calling current_env_java_version()
in a loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, your talking about the outer loop for upgrade in MULTI_UPGRADES:
fcd0294
to
b841171
Compare
Run generated upgrade_through_versions_test on pytest >7.2.0
pytest-7.2.0 changed how markers were inherited, pytest-dev/pytest#7792
Remove how internode_ssl was changing seeds to append the ssl storage port, it's not needed as the tests always already set enable_legacy_ssl_storage_port to true.