[Box Backup-commit] COMMIT r2838 - box/trunk/test/bbackupd

subversion at boxbackup.org subversion at boxbackup.org
Sun Jan 9 11:54:01 GMT 2011


Author: chris
Date: 2011-01-09 11:54:00 +0000 (Sun, 09 Jan 2011)
New Revision: 2838

Modified:
   box/trunk/test/bbackupd/testbbackupd.cpp
Log:
Add intercept logging, seems to work around intermittent failures in
testbbackupd:

{{{
Waiting for internal daemon to scan spacetest/d1: ............ done.
Waiting for server to die (pid 6307): .............................. failed!
ERROR:   **** TEST FAILURE: Condition [killed_server] failed at testbbackupd.cpp:718
ERROR:   **** TEST FAILURE: Condition [stop_internal_daemon(pid)] failed at testbbackupd.cpp:1153
}}}


Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp	2011-01-09 01:58:05 UTC (rev 2837)
+++ box/trunk/test/bbackupd/testbbackupd.cpp	2011-01-09 11:54:00 UTC (rev 2838)
@@ -749,14 +749,24 @@
 
 extern "C" struct dirent *readdir_test_hook_2(DIR *dir)
 {
-	if (time(NULL) >= readdir_stop_time)
+	time_t time_now = time(NULL);
+
+	if (time_now >= readdir_stop_time)
 	{
 #ifndef PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE
+		BOX_NOTICE("Cancelling readdir hook at " << time_now);
 		intercept_setup_readdir_hook(NULL, NULL);
 		intercept_setup_lstat_hook  (NULL, NULL);
 		// we will not be called again.
+#else
+		BOX_NOTICE("Failed to cancel readdir hook at " << time_now);
 #endif
 	}
+	else
+	{
+		BOX_INFO("readdir hook still active at " << time_now << ", "
+			"waiting for " << readdir_stop_time);
+	}
 
 	// fill in the struct dirent appropriately
 	memset(&readdir_test_dirent, 0, sizeof(readdir_test_dirent));
@@ -768,6 +778,7 @@
 	snprintf(readdir_test_dirent.d_name, 
 		sizeof(readdir_test_dirent.d_name),
 		"test.%d", readdir_test_counter);
+	BOX_INFO("readdir hook returning " << readdir_test_dirent.d_name);
 
 	// ensure that when bbackupd stats the file, it gets the 
 	// right answer




More information about the Boxbackup-commit mailing list