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

Removing the escape sequence from the output of get_cpu_count()! #4051

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

Conversation

Anushree-Mathur
Copy link

The get_cpu_count function is returning the output containing the escape sequence so the checks are failing, I have removed the escape sequence from the output then returned it!
Signed-off-by: Anushree Mathur [email protected]

@Anushree-Mathur
Copy link
Author

There are almost 300-400 testcases failing because of this issue, 1 of the example is as follows:

Before applying the patch:

[stdout]
[stdout] nonempty lines in until last line matches ['lscpu | grep "^CPU(s)" | grep -o "[0-9]*"', '\x1b[?2004l\x1b[01;31m\x1b[K64\x1b[m\x1b[K', '\x1b[?2004h[root@localhost ~]# ']
[stdout]
[stdout] Nonempty lines are true in read_until_last ['lscpu | grep "^CPU(s)" | grep -o "[0-9]*"', '\x1b[?2004l\x1b[01;31m\x1b[K64\x1b[m\x1b[K', '\x1b[?2004h[root@localhost ~]# ']
[stdout]
[stdout] NEW NONEMPTY LIST ['lscpu | grep "^CPU(s)" | grep -o "[0-9]*"', '64', '[root@localhost ~]# ']
[stdout]
[stdout] output for cpu hotplug ^[[?2004l^[[01;31m^[[K64^[[m^[[K
[stdout]
[stdlog] 2025-01-07 01:09:50,863 avocado.virttest.cpu cpu              L1226 DEBUG| CPU quantity mismatched !!! guest said it got 2004 but we assigned 64

[stdlog] 2025-01-07 01:13:50,192 avocado.virttest.virsh virsh            L1666 DEBUG| Undefine VM avocado-vt-vm1
[stdlog] 2025-01-07 01:13:50,222 avocado.virttest.virsh virsh            L1651 DEBUG| Define VM from /var/tmp/xml_utils_temp_shfrud6i.xml
[stdlog] 2025-01-07 01:13:50,253 avocado.virsh_migrate virsh_migrate    L1383 INFO | Remove the NFS image...
[stdlog] 2025-01-07 01:13:50,253 avocado.utils.process process          L0658 INFO | Running 'rm -f /home/sharing/nfs-img'
[stdlog] 2025-01-07 01:13:50,282 avocado.utils.process process          L0715 INFO | Command 'rm -f /home/sharing/nfs-img' finished with 0 after 0.028729856s
[stdlog] 2025-01-07 01:13:50,283 avocado.test stacktrace       L0041 ERROR|
[stdlog] 2025-01-07 01:13:50,283 avocado.test stacktrace       L0043 ERROR| Reproduced traceback from: /usr/local/lib/python3.13/site-packages/avocado_vt/test.py:298
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR| Traceback (most recent call last):
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|   File "/home/migration/tests/data/avocado-vt/virttest/test-providers.d/downloads/io-github-autotest-libvirt/libvirt/tests/src/virsh_cmd/domain/virsh_migrate.py", line 404, in cpu_hotplug_hotunplug
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     test.fail("CPU %s failed" % operation)
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|   File "/usr/local/lib/python3.13/site-packages/avocado/core/test.py", line 754, in wrapper
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     return func(actual_message)
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|   File "/usr/local/lib/python3.13/site-packages/avocado/core/test.py", line 770, in fail
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     raise exceptions.TestFail(msg)
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR| avocado.core.exceptions.TestFail: CPU Hotplug failed
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR| During handling of the above exception, another exception occurred:
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR| Traceback (most recent call last):
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|   File "/home/migration/tests/data/avocado-vt/virttest/test-providers.d/downloads/io-github-autotest-libvirt/libvirt/tests/src/virsh_cmd/domain/virsh_migrate.py", line 1229, in run
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     cpu_hotplug_hotunplug(vm, max_vcpus, "Hotplug", uri=uri)
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|   File "/home/migration/tests/data/avocado-vt/virttest/test-providers.d/downloads/io-github-autotest-libvirt/libvirt/tests/src/virsh_cmd/domain/virsh_migrate.py", line 408, in cpu_hotplug_hotunplug
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     test.fail("CPU %s failed - %s" % (operation, info))
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|   File "/usr/local/lib/python3.13/site-packages/avocado/core/test.py", line 754, in wrapper
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     return func(actual_message)
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|   File "/usr/local/lib/python3.13/site-packages/avocado/core/test.py", line 770, in fail
[stdlog] 2025-01-07 01:13:50,286 avocado.test stacktrace       L0050 ERROR|     raise exceptions.TestFail(msg)
[stdlog] 2025-01-07 01:13:50,287 avocado.test stacktrace       L0050 ERROR| avocado.core.exceptions.TestFail: CPU Hotplug failed - CPU Hotplug failed
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: STARTED
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: PASS (227.21 s)
 (2/3) type_specific.io-github-autotest-libvirt.virsh.migrate.there_live.normal_test.with_cpu_hotplug.with_hotplug.hotplug_after_migration.with_postcopy: STARTED
 (2/3) type_specific.io-github-autotest-libvirt.virsh.migrate.there_live.normal_test.with_cpu_hotplug.with_hotplug.hotplug_after_migration.with_postcopy: FAIL: CPU Hotplug failed - CPU Hotplug failed (498.77 s)
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: STARTED
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: PASS (5.17 s)

After applying the patch

[stdout] output for cpu hotplug ^[[?2004l^[[01;31m^[[K64^[[m^[[K
[stdout]
[stdout] output with no escape 64
[stdout]
[stdlog] 2025-01-07 01:23:56,019 avocado.virttest.cpu cpu              L1231 INFO | CPU quantity matched: 64
[stdlog] 2025-01-07 01:23:56,019 avocado.virsh_migrate virsh_migrate    L0406 DEBUG| CPU Hotplug successful !!!
[stdlog] 2025-01-07 01:23:56,019 avocado.virsh_migrate virsh_migrate    L1260 DEBUG| Recovering libvirtd status.
[stdlog] 2025-01-07 01:23:56,019 avocado.virsh_migrate virsh_migrate    L1265 DEBUG| Checking avocado-vt-vm1 state on target qemu+ssh://9.3.101.194/system.
[stdlog] 2025-01-07 01:23:56,019 avocado.virsh_migrate virsh_migrate    L1271 INFO | Supposed state: running
[stdlog] 2025-01-07 01:23:56,659 avocado.virsh_migrate virsh_migrate    L1273 INFO | Actual state: running
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: STARTED
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: PASS (37.29 s)
 (2/3) type_specific.io-github-autotest-libvirt.virsh.migrate.there_live.normal_test.with_cpu_hotplug.with_hotplug.hotplug_after_migration.with_postcopy: STARTED
 (2/3) type_specific.io-github-autotest-libvirt.virsh.migrate.there_live.normal_test.with_cpu_hotplug.with_hotplug.hotplug_after_migration.with_postcopy: PASS (236.92 s)
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: STARTED
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: PASS (5.43 s)

@nickzhq
Copy link
Contributor

nickzhq commented Jan 13, 2025

Hello @Anushree-Mathur , please handle the error from "Static checks". Thanks!

The get_cpu_count function is returning the output containing the
escape sequence so the checks are failing, I have removed the escape
sequence from the output then returned it!
Signed-off-by: Anushree Mathur <[email protected]>
@Anushree-Mathur
Copy link
Author

Hello @Anushree-Mathur , please handle the error from "Static checks". Thanks!

Thank you @nickzhq , the issue has been fixed now! Thank you for your time. Would like to hear more review comments on this! Thanks in advance.

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