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

can not get nvme ns immediately after create nvme ctrl #1080

Open
guazhangRH opened this issue Nov 30, 2024 · 0 comments
Open

can not get nvme ns immediately after create nvme ctrl #1080

guazhangRH opened this issue Nov 30, 2024 · 0 comments

Comments

@guazhangRH
Copy link
Contributor

maybe need wait a sec after created nvme ctrl in nvme_test

======================================================================
ERROR: test_ns_info (nvme_test.NVMeTestCase.test_ns_info)
Test namespace info
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/rpmbuild/BUILD/libblockdev-3.2.0/tests/nvme_test.py", line 92, in test_ns_info
    info = BlockDev.nvme_get_namespace_info(self.nvme_ns_dev)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: g-bd-nvme-error-quark: Failed to open device '/dev/nvme0n1': No such file or directory (1)
======================================================================
FAIL: test_connect_multiple_ns (nvme_test.NVMeFabricsTestCase.test_connect_multiple_ns)
Test connect and disconnect multiple namespaces
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/rpmbuild/BUILD/libblockdev-3.2.0/tests/nvme_test.py", line 443, in test_connect_multiple_ns
    self.assertEqual(len(namespaces), NUM_NS)
AssertionError: 1 != 3
----------------------------------------------------------------------

nvme-cli-2.10.2-1.el10.x86_64
nvmetcli-0.8-1.el10.noarch

$ git diff tests/utils.py 
diff --git a/tests/utils.py b/tests/utils.py
index a9b8e187..9fe93605 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -251,7 +251,7 @@ def find_nvme_ctrl_devs_for_subnqn(subnqn):
                         dev_paths += [path]
                 except:
                     pass
-
+    time.sleep(1)
     ret, out, err = run_command("nvme list --output-format=json --verbose")
     if ret != 0:
         raise RuntimeError("Error getting NVMe list: '%s %s'" % (out, err))

for i in $(seq 30);do python3 run_tests.py -s nvme_test || break;done

can not reproduce the error after apply the patch, maybe someone have a better solution for the error.
if no, I will create a MR for it.

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

No branches or pull requests

1 participant