]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd/test_notify.py: force line-buffered output 62751/head
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:01:45 +0000 (21:01 +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 03ecf1263a8cdd7e75d82119fd23280b4f84a84e..4840add8dc452b0148700c545efa7de804317ac9 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/python3
+import functools
 import os
 import sys
 import time
@@ -14,6 +15,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'