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

Refactoring log format by removing metadata addition in log statements. #4220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AmarnatReddy
Copy link
Contributor

@AmarnatReddy AmarnatReddy commented Nov 13, 2024

Description

Refactoring log format by removing metadata addition in log statements.

Parallel tests : http://magna002.ceph.redhat.com/cephci-jenkins/cephci-run-EDH5VP/
as part of suite i have 2 tests running in parallel. I did not make any changes in test files
test1: http://magna002.ceph.redhat.com/cephci-jenkins/cephci-run-EDH5VP/Increase%20and%20Decrease%20of%20MDS.log
test2:http://magna002.ceph.redhat.com/cephci-jenkins/cephci-run-EDH5VP/nfs-ganesha_with_cephfs.log
suite file :

  • test:
    name: Parallel run
    desc: FS tier-0 parallelly.
    module: test_parallel.py
    parallel:
    - test:
    name: nfs-ganesha_with_cephfs
    module: cephfs_tier1_ops.py
    desc: Configure nfs-ganesha on nfs server,do mount on any client and do IOs
    polarion-id: CEPH-83574439
    abort-on-fail: false
    - test:
    name: Increase and Decrease of MDS
    module: mds_inc_dec.py
    desc: Deploy mds using cephadm and increase & decrease number of mds.
    polarion-id: CEPH-83574286
    abort-on-fail: false

Running test: Parallel run
Test logfile location: http://magna002.ceph.redhat.com/cephci-jenkins/cephci-run-EDH5VP/Parallel_run_0.log

2024-11-21 14:49:36,819 (root) - run:722 - run - [INFO] - Running test test_parallel.py
2024-11-21 14:49:36,874 (cephfs_tier1_ops) - test_parallel:72 - execute - [INFO] - Starting test: nfs-ganesha_with_cephfs
2024-11-21 14:49:36,886 (cephfs_tier1_ops) - cephfs_tier1_ops:66 - run - [INFO] - checking Pre-requisites
2024-11-21 14:49:37,875 (mds_inc_dec) - test_parallel:72 - execute - [INFO] - Starting test: Increase and Decrease of MDS
2024-11-21 14:49:47,989 (mds_inc_dec) - mds_inc_dec:33 - run - [INFO] - checking Pre-requisites
2024-11-21 14:49:48,996 (mds_inc_dec) - test_parallel:89 - execute - [INFO] - Test Increase and Decrease of MDS completed with result: PASS
2024-11-21 14:50:36,942 (cephfs_tier1_ops) - cephfs_tier1_ops:69 - run - [ERROR] - This test requires minimum 2 client nodes.This has only 1 clients
2024-11-21 14:50:36,945 (cephfs_tier1_ops) - test_parallel:89 - execute - [INFO] - Test nfs-ganesha_with_cephfs completed with result: FAILED
2024-11-21 14:50:36,950 (test_parallel) - test_parallel:35 - run - [INFO] - Final test results: {'Increase and Decrease of MDS': 0, 'nfs-ganesha_with_cephfs': 1}
2024-11-21 14:50:36,952 (test_parallel) - test_parallel:39 - run - [INFO] - Increase and Decrease of MDS test result is PASS
2024-11-21 14:50:36,952 (test_parallel) - test_parallel:39 - run - [INFO] - nfs-ganesha_with_cephfs test result is FAILED
2024-11-21 14:50:36,962 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute podman --version | awk {'print $3'} on 10.0.65.58
2024-11-21 14:50:37,966 (ceph.ceph) - ceph:1600 - long_running - [INFO] - Execution of podman --version | awk {'print $3'} on 10.0.65.58 took 1.003849 seconds.
2024-11-21 14:50:37,966 (root) - run:1052 - collect_recipe - [INFO] - Podman Version 5.2.2
2024-11-21 14:50:37,968 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute docker --version | awk {'print $3'} on 10.0.65.58
2024-11-21 14:50:38,972 (ceph.ceph) - ceph:1600 - long_running - [INFO] - Execution of docker --version | awk {'print $3'} on 10.0.65.58 took 1.003481 seconds.
2024-11-21 14:50:38,974 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute ceph --version | awk '{print $3}' on 10.0.64.144
2024-11-21 14:50:39,979 (ceph.ceph) - ceph:1600 - long_running - [INFO] - Execution of ceph --version | awk '{print $3}' on 10.0.64.144 took 1.004031 seconds.
2024-11-21 14:50:39,980 (root) - run:1068 - collect_recipe - [INFO] - ceph Version 19.2.0-53.el9cp
2024-11-21 14:50:39,981 (root) - run:914 - run - [INFO] - Test <module 'test_parallel' from '/home/amk/log_finish/cephci/tests/parallel/test_parallel.py'> failed
Test <module 'test_parallel' from '/home/amk/log_finish/cephci/tests/parallel/test_parallel.py'> failed
2024-11-21 14:50:39,981 (root) - run:951 - run - [INFO] - 
All test logs located here: http://magna002.ceph.redhat.com/cephci-jenkins/cephci-run-EDH5VP
2024-11-21 14:50:39,982 (utility.xunit) - xunit:81 - create_xunit_results - [INFO] - Creating xUnit tier-0_fs_1 for test run-id RHCS-8-0-tier-0_fs_1-EDH5VP
2024-11-21 14:50:39,997 (utility.xunit) - xunit:133 - create_xunit_results - [INFO] - xUnit result file created: /ceph/cephci-jenkins/cephci-run-EDH5VP/xunit.xml

All test logs located here: http://magna002.ceph.redhat.com/cephci-jenkins/cephci-run-EDH5VP

TEST NAME                        TEST DESCRIPTION                                               DURATION                         STATUS                    COMMENTS
Parallel run                     FS tier-0 parallelly.                                          0:01:03.161864                   Failed         

2024-11-21 14:50:40,287 (utility.utils) - utils:1138 - email_results - [INFO] - Results have been emailed to ['[email protected]']
2024-11-21 14:50:40,287 (root) - run:1007 - run - [INFO] -

Generating sosreports for all the nodes due to failures in testcase
2024-11-21 14:50:40,287 (root) - run:1011 - run - [INFO] - Installing Ceph-common on ceph nodes to gather Sos report
2024-11-21 14:50:40,289 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute yum install -y ceph-common --nogpgcheck on 10.0.65.58
2024-11-21 14:50:42,856 (ceph.ceph) - ceph:1600 - long_running - [INFO] - Execution of yum install -y ceph-common --nogpgcheck on 10.0.65.58 took 2.56767 seconds.
2024-11-21 14:50:42,858 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute mkdir -p /etc/ceph on 10.0.65.58
2024-11-21 14:50:43,902 (ceph.ceph) - ceph:1600 - long_running - [INFO] - Execution of mkdir -p /etc/ceph on 10.0.65.58 took 1.04412 seconds.
2024-11-21 14:50:43,904 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute cephadm shell -- ceph auth get client.admin on 10.0.65.58
2024-11-21 14:50:45,382 (ceph.ceph) - ceph:1600 - long_running - [INFO] - Execution of cephadm shell -- ceph auth get client.admin on 10.0.65.58 took 1.477583 seconds.
2024-11-21 14:50:45,448 (paramiko.transport.sftp) - sftp:169 - _log - [INFO] - [chan 5] Opened sftp connection (server version 3)
2024-11-21 14:50:45,451 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute cephadm shell -- ceph config generate-minimal-conf on 10.0.65.58
2024-11-21 14:50:47,800 (ceph.ceph) - ceph:1600 - long_running - [INFO] - Execution of cephadm shell -- ceph config generate-minimal-conf on 10.0.65.58 took 2.348358 seconds.
2024-11-21 14:50:47,825 (paramiko.transport.sftp) - sftp:169 - _log - [INFO] - [chan 7] Opened sftp connection (server version 3)
2024-11-21 14:50:47,831 (ceph.ceph) - ceph:1570 - long_running - [INFO] - Execute yum install -y ceph-common --nogpgcheck on 10.0.65.49
Single test : http://magna002.ceph.redhat.com/cephci-jenkins/cephci-run-XRBX1X/

  - test:
      name: Increase and Decrease of MDS
      module: mds_inc_dec.py
      desc: Deploy mds using cephadm and increase & decrease number of mds.
      polarion-id: CEPH-83574286
      abort-on-fail: false

Please include Automation development guidelines. Source of Test case - New Feature/Regression Test/Close loop of customer BZs

click to expand checklist
  • Create a test case in Polarion reviewed and approved.
  • Create a design/automation approach doc. Optional for tests with similar tests already automated.
  • Review the automation design
  • Implement the test script and perform test runs
  • Submit PR for code review and approve
  • Update Polarion Test with Automation script details and update automation fields
  • If automation is part of Close loop, update BZ flag qe-test_coverage “+” and link Polarion test

Copy link
Contributor

openshift-ci bot commented Nov 13, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AmarnatReddy

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@psathyan psathyan left a comment

Choose a reason for hiding this comment

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

@AmarnatReddy thanks for taking the initiative on fixing the logging.

if I understand correctly, we decided to remove this entire file.

@psathyan
Copy link
Contributor

Thanks @AmarnatReddy for the explanation.

This is good approach and the modification effort is minimal. Let's evaluate parallel.

if it is working, we should be able to get this merged.

@AmarnatReddy AmarnatReddy force-pushed the log_rewap branch 2 times, most recently from 975974b to 1e56ec3 Compare November 22, 2024 04:58
Copy link
Contributor

@psathyan psathyan left a comment

Choose a reason for hiding this comment

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

Thanks @AmarnatReddy I think we are getting close

)
console_handler = logging.StreamHandler()
Copy link
Contributor

Choose a reason for hiding this comment

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

By default logging to console is enabled. Do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

HI Satya
With out this parallel logs of the suites were not logging to console

Comment on lines 83 to 89
rc = test_mod.run(
ceph_cluster=args["ceph_cluster"],
ceph_nodes=args["ceph_nodes"],
config=args["config"],
test_data=args["test_data"],
ceph_cluster_dict=args["ceph_cluster_dict"],
clients=args["clients"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we ensure we run.py and test_parallel.py use the same signature when calling test module run method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

self.info = self._logger.info
self.debug = self._logger.debug
self.warning = self._logger.warning
self.error = self._logger.error
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a method error and an attribute error likewize self._logger.error is a method. This is a bit confusing.

Since we are adding messages as part of error method, I believe we shouldn't have this attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have attribute self._log_errors = [] which we are using to log all the errors collected. This list is used in run.py in Exception block to display the errors

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.

2 participants