]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd/test_notify.py: force line-buffered output
authorIlya Dryomov <idryomov@gmail.com>
Mon, 7 Apr 2025 10:40:50 +0000 (12:40 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 9 Apr 2025 19:02:58 +0000 (21:02 +0200)
"master" and "slave" invocations are intended to run in parallel and
coordinate between themselves.  Ensure that their respective output is
properly timestamped and ordered in teuthology.log file.

Fixes: https://tracker.ceph.com/issues/70831
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 49dbabcecec7c458a6d2ddfbd8e14a6ec419b953)

src/test/librbd/test_notify.py

index 4e929d74fa46585aaec58242aa95b79e05e0bae1..bef988808aef0681a2b858c490ab5c4c2cd2c255 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/python3
+import functools
 import os
 import sys
 import time
@@ -13,6 +14,8 @@ from rbd import (RBD,
                  RBD_FEATURE_FAST_DIFF,
                  RBD_FLAG_OBJECT_MAP_INVALID)
 
+print = functools.partial(print, flush=True)
+
 POOL_NAME='rbd'
 PARENT_IMG_NAME='test_notify_parent'
 CLONE_IMG_NAME='test_notify_clone'