Skip to contentSkip to conversation

master - test: Print a heartbeat file (every 20s) in the runner.

PATCH Petr Rockai 1 participant 1 message Feb 5, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3fbea6029d77ce49434d0680b34d9dd367bce755
Commit:        3fbea6029d77ce49434d0680b34d9dd367bce755
Parent:        e8cc9254e038b59bb6cc5ec9ba7793f9a82ab150
Author:        Petr Rockai <[email protected]>
AuthorDate:    Fri Jun 27 23:18:14 2014 +0200
Committer:     Petr Rockai <[email protected]>
CommitterDate: Thu Feb 5 13:47:18 2015 +0100

test: Print a heartbeat file (every 20s) in the runner.

---
 test/lib/runner.cpp |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
test/lib/runner.cpp +9 -0
index 1e61a68..b617110 100644
@@ -188,6 +188,15 @@ struct TestCase {
 
 		io.sync();
 
+		/* heartbeat */
+		if ( time( 0 ) % 20 == 0 ) {
+			std::string stampfile( options.outdir + "/timestamp" );
+			std::ofstream stamp( stampfile.c_str() );
+			stamp << time( 0 );
+			stamp.close();
+			fsync_name( stampfile );
+		}
+
 		return true;
 	}