git » libjio » commit a653072

tests: Flush stdout before fork()

author Alberto Bertogli
2009-07-15 18:49:29 UTC
committer Alberto Bertogli
2009-07-15 18:49:29 UTC
parent a25fb20b54b3ed12ad8e4a187cf320889a279ddb

tests: Flush stdout before fork()

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

tests/behaviour/tf.py +1 -0
tests/stress/jiostress +1 -0

diff --git a/tests/behaviour/tf.py b/tests/behaviour/tf.py
index a4fd9b9..9b0a189 100644
--- a/tests/behaviour/tf.py
+++ b/tests/behaviour/tf.py
@@ -38,6 +38,7 @@ def tmppath():
 
 def run_forked(f, *args, **kwargs):
 	"""Runs the function in a different process."""
+	sys.stdout.flush()
 	pid = os.fork()
 	if pid == 0:
 		# child
diff --git a/tests/stress/jiostress b/tests/stress/jiostress
index a6f816b..83973cb 100755
--- a/tests/stress/jiostress
+++ b/tests/stress/jiostress
@@ -106,6 +106,7 @@ class Stresser:
 	def randwrite_fork(self):
 		# do the prep before the fork so we can verify() afterwards
 		nd, start = self.prep_randwrite()
+		sys.stdout.flush()
 		pid = os.fork()
 		if pid == 0:
 			# child