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

fix(test_user_batch_custom_time): handle stress command correctly #9345

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

fruch
Copy link
Contributor

@fruch fruch commented Nov 24, 2024

seems like we were running into situations we try to add all nodes ips into stress commands, and it's the test code

File ".../longevity_test.py", line 300, in test_user_batch_custom_time
self._run_user_stress_in_batches(batch_size=batch_size,
File ".../longevity_test.py", line 336, in _run_user_stress_in_batches
batch_params['stress_cmd'] += [params['stress_cmd'] + nodes_ips]
TypeError: list indices must be integers or slices, not str

in this change remove a parentheses that was causing function to return tuple and not string as expected

Testing

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)
  • Add unit tests to cover my changes (under unit-test/ folder)
  • Update the Readme/doc folder relevant to this change (if needed)

@fruch fruch added backport/2024.2 Need backport to 2024.2 backport/6.2 labels Nov 24, 2024
@fruch fruch requested a review from a team November 25, 2024 08:51
@fruch fruch marked this pull request as ready for review November 25, 2024 09:00
roydahan
roydahan previously approved these changes Nov 25, 2024
soyacz
soyacz previously approved these changes Nov 25, 2024
Copy link
Contributor

@soyacz soyacz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@vponomaryov vponomaryov left a comment

Choose a reason for hiding this comment

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

Need to fix unit tests

seems like we were running into situations we try to add all nodes ips into
stress commands, and it's the test code
```
File ".../longevity_test.py", line 300, in test_user_batch_custom_time
self._run_user_stress_in_batches(batch_size=batch_size,
File ".../longevity_test.py", line 336, in _run_user_stress_in_batches
batch_params['stress_cmd'] += [params['stress_cmd'] + nodes_ips]
TypeError: list indices must be integers or slices, not str
```

in this change remove a parentheses that was causing function to return
tuple and not string as expected
# for now we'll leave to just one fresh table, to kick schema update
num_of_newly_created_tables = 1
self._pre_create_templated_user_schema(batch_start=extra_tables_idx,
batch_end=extra_tables_idx+num_of_newly_created_tables)
for i in range(num_of_newly_created_tables):
batch.append(self.create_templated_user_stress_params(extra_tables_idx + i, cs_profile=cs_profile))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the core of the fix

@fruch
Copy link
Contributor Author

fruch commented Nov 25, 2024

the test in 2024.2 reproducers, did proved this is fixing the issue.
and there also a unittest introduce that did demonstrate the bug, and now running cleanly.

Copy link
Contributor

@vponomaryov vponomaryov left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -109,6 +109,8 @@ pipeline {
steps {
script {
try {
checkoutQaInternal(params)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cause the unittest is going via code path that depends on configuration files existing in the internal repo
i.e. the 5000 tables case has the user profile yaml there.

@scylladbbot scylladbbot added the backport/2024.2-done Commit backported to 2024.2 label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants