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(OutputWatcher): use formatted string in log message #7493

Merged
merged 1 commit into from
May 28, 2024

Conversation

soyacz
Copy link
Contributor

@soyacz soyacz commented May 28, 2024

Sometimes line for output could contain '%s' or '0.0%' and this break OutputWatcher log function with error:

18:42:47      msg = msg % self.args
18:42:47  ValueError: incomplete format

File "/home/ubuntu/scylla-cluster-tests/sdcm/remote/libssh2_client/__init__.py",
    line 449, in _process_output
      watcher.submit_line(data)
File "/home/ubuntu/scylla-cluster-tests/sdcm/remote/base.py",
    line 231, in submit_line
      self.log.debug("<%s>: " + line.rstrip('\n'), self.hostname)
Message: '<%s>: Percent Repaired       : 0.0%'
Arguments: ('10.4.0.228',)

Change format for log message info

self.log.debug("%s - %s', self.hostname, line)

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)

Sometimes line for output  could contain '%s' or '0.0%' and this break
OutputWatcher log function with error:
```
18:42:47      msg = msg % self.args
18:42:47  ValueError: incomplete format

File "/home/ubuntu/scylla-cluster-tests/sdcm/remote/libssh2_client/__init__.py",
    line 449, in _process_output
      watcher.submit_line(data)
File "/home/ubuntu/scylla-cluster-tests/sdcm/remote/base.py",
    line 231, in submit_line
      self.log.debug("<%s>: " + line.rstrip('\n'), self.hostname)
Message: '<%s>: Percent Repaired       : 0.0%'
Arguments: ('10.4.0.228',)
```

Change format for log message info

self.log.debug("%s - %s', self.hostname, line)
Copy link
Contributor

@fruch fruch left a comment

Choose a reason for hiding this comment

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

LGTM

Mark the backports needed

@soyacz
Copy link
Contributor Author

soyacz commented May 28, 2024

LGTM

Mark the backports needed

actually looks breaking commit wasn't backported yet. If we backport it to 6.0 then we need to do with this one the same.

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

@soyacz
Copy link
Contributor Author

soyacz commented May 28, 2024

@fruch linting failed on kafka test:

08:46:29  ---- linting: ./test-cases/kafka/longevity-kafka-cdc.yaml -----
08:46:29  Traceback (most recent call last):
08:46:29    File "/tmp/jenkins/workspace/can_scylla-cluster-tests_PR-7493/./sct.py", line 795, in _run_yaml_test
08:46:29      config = SCTConfiguration()
08:46:29    File "/tmp/jenkins/workspace/can_scylla-cluster-tests_PR-7493/sdcm/sct_config.py", line 1961, in __init__
08:46:29      self['kafka_connectors'] = [SctKafkaConfiguration(**connector)
08:46:29    File "/tmp/jenkins/workspace/can_scylla-cluster-tests_PR-7493/sdcm/sct_config.py", line 1961, in <listcomp>
08:46:29      self['kafka_connectors'] = [SctKafkaConfiguration(**connector)
08:46:29    File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
08:46:29  pydantic.error_wrappers.ValidationError: 1 validation error for SctKafkaConfiguration
08:46:29  source
08:46:29    field required (type=value_error.missing)

Copy link
Contributor

@aleksbykov aleksbykov left a comment

Choose a reason for hiding this comment

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

LGTM

@fruch
Copy link
Contributor

fruch commented May 28, 2024

@fruch linting failed on kafka test:

08:46:29  ---- linting: ./test-cases/kafka/longevity-kafka-cdc.yaml -----
08:46:29  Traceback (most recent call last):
08:46:29    File "/tmp/jenkins/workspace/can_scylla-cluster-tests_PR-7493/./sct.py", line 795, in _run_yaml_test
08:46:29      config = SCTConfiguration()
08:46:29    File "/tmp/jenkins/workspace/can_scylla-cluster-tests_PR-7493/sdcm/sct_config.py", line 1961, in __init__
08:46:29      self['kafka_connectors'] = [SctKafkaConfiguration(**connector)
08:46:29    File "/tmp/jenkins/workspace/can_scylla-cluster-tests_PR-7493/sdcm/sct_config.py", line 1961, in <listcomp>
08:46:29      self['kafka_connectors'] = [SctKafkaConfiguration(**connector)
08:46:29    File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
08:46:29  pydantic.error_wrappers.ValidationError: 1 validation error for SctKafkaConfiguration
08:46:29  source
08:46:29    field required (type=value_error.missing)

adderssing it on #7498

@fruch fruch merged commit 40ebca9 into scylladb:master May 28, 2024
4 of 6 checks passed
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.

None yet

4 participants