diff --git a/constants.php b/constants.php index bb44269999b937b1843114d20ec945bb049e38f0..984cbc3eeeb31b79f1b8ff8dd1e547509aa80d15 100644 --- a/constants.php +++ b/constants.php @@ -3,7 +3,7 @@ # variables //use this to know which version we published -$versionString = '2.6.1'; +$versionString = '2.6.2'; $rootDirNameToUseString = 'work'; $isDebug = false; //logs debug to STDOUT diff --git a/do_blackBoxTest_func.php b/do_blackBoxTest_func.php index 31149c993d0bfd48ac9963ff0250a3aa0061b597..451824b19ff4e1b0cac3077446141a07d64f5618 100644 --- a/do_blackBoxTest_func.php +++ b/do_blackBoxTest_func.php @@ -73,6 +73,8 @@ function do_blackBoxTest($conn, $traceString, $sourceCode, $mainFileNameWithExt $testContent = $test[$s_test_content]; $allAssets = $test[$s_test_allAssets]; + addToDebugTimings("before creating test assets"); + # create the assets for the current test if (createTestAssets($allAssets, $fullWorkingDirPath) === FALSE) { //error message is in createFiles function @@ -85,6 +87,7 @@ function do_blackBoxTest($conn, $traceString, $sourceCode, $mainFileNameWithExt $s_timeForUserProgram => NULL, ); } + addToDebugTimings("after creating test assets"); $longCmd = $config['runner'] @@ -110,7 +113,6 @@ function do_blackBoxTest($conn, $traceString, $sourceCode, $mainFileNameWithExt require_once './transactionHelper.php'; addTraceLogToDb($conn, $config, $traceString, $longCmd, $sourceCode); - if ($isDebug) { debug("using runner: " . $config['runner']); debug("full command: " . $longCmd); @@ -133,6 +135,8 @@ function do_blackBoxTest($conn, $traceString, $sourceCode, $mainFileNameWithExt $env = $config['environmentVarsParsed']; + addToDebugTimings("starting runner"); + # without bypass_shell it won't work on windows $process = proc_open($longCmd, $pipesDescriptor, $pipes, $fullWorkingDirPath, $env, array('bypass_shell' => TRUE)); @@ -166,6 +170,8 @@ function do_blackBoxTest($conn, $traceString, $sourceCode, $mainFileNameWithExt debug("error during execution of the (blackbox) test runner: " . $errorOutput); } + addToDebugTimings("finished runner"); + # the test assets are removed when the dir gets removed # also the test runner could renamed/added/deleted some files @@ -185,6 +191,8 @@ function do_blackBoxTest($conn, $traceString, $sourceCode, $mainFileNameWithExt $compileTimeout = intval($compileTimeout, 10); } + addToDebugTimings("finished parsing runner header"); + return array( $s_return_val => $return_var, $s_output => $headerPart[$s_output_without_header_part], diff --git a/do_compareFilesTest_func.php b/do_compareFilesTest_func.php index ff02eae0bfe8691df67b1b40a7c4cbff1f5bed91..a83b4122496c32bc414a5b12e87364e8d29f5be0 100644 --- a/do_compareFilesTest_func.php +++ b/do_compareFilesTest_func.php @@ -134,6 +134,8 @@ function do_compareFilesTest($conn, $traceString, $sourceCode, $mainFileNameWith $env = $config['environmentVarsParsed']; + addToDebugTimings("starting runner"); + # without bypass_shell it won't work on windows $process = proc_open($longCmd, $pipesDescriptor, $pipes, $fullWorkingDirPath, $env, array('bypass_shell' => TRUE)); @@ -167,6 +169,7 @@ function do_compareFilesTest($conn, $traceString, $sourceCode, $mainFileNameWith debug("error during execution of the (blackbox) test runner: " . $errorOutput); } + addToDebugTimings("finished runner"); # the test assets are removed when the dir gets removed # also the test runner could renamed/added/deleted some files diff --git a/do_compileTest_func.php b/do_compileTest_func.php index da51206c84a1f4f699fbdebafd25cd7163e11431..87ec07254527e248e9be5eec46bd247c65d4e977 100644 --- a/do_compileTest_func.php +++ b/do_compileTest_func.php @@ -77,6 +77,8 @@ function do_compile($conn, $traceString, $sourceCode, $mainFileNameWithExtension 2 => array("pipe", "w") ); + addToDebugTimings("starting runner"); + $process = proc_open($longCmd, $descriptorspec, $pipes, $fullWorkingDirPath, $env, array('bypass_shell' => TRUE)); if (is_resource($process)) { @@ -94,6 +96,8 @@ function do_compile($conn, $traceString, $sourceCode, $mainFileNameWithExtension debug("error during execution of the (compile) test runner: " . $errorOutput); } + addToDebugTimings("finished runner"); + $headerPart = parseHeaderPart($output); # in case the test runner didn't even run we may need to cast (vals from db) diff --git a/transactionHelper.php b/transactionHelper.php index afb065ab7ee2493ee3ebc929958d9583b96b3db4..8720df99d54964259a647e60421e3e2cb3e49ec8 100644 --- a/transactionHelper.php +++ b/transactionHelper.php @@ -58,6 +58,8 @@ function addTraceLogToDb($conn, $config, $traceString, $processString, $sourceCo if ($insertTraceLogs === TRUE) { + addToDebugTimings("before inserting trace log"); + debug(strlen($sourceCode)); $tableName = $config[$s_arg_dbTraceTableName]; @@ -74,6 +76,8 @@ function addTraceLogToDb($conn, $config, $traceString, $processString, $sourceCo output($status_code_DbIssue, 'could not add trace log'); exit(1); } + + addToDebugTimings("after inserting trace log"); } } @@ -98,6 +102,8 @@ function removeOldTraceLogs($conn, $config, $s_deleteTraceLogOlderThanMinutes) { if ($deleteTraceLogOlderThanMinutes > 0) { + addToDebugTimings("before deleting old trace logs"); + $sql = "DELETE FROM `" . $tableName . "` WHERE dateTime < (NOW() - INTERVAL :olderThan MINUTE);"; $params = array( ':olderThan' => $deleteTraceLogOlderThanMinutes @@ -108,9 +114,13 @@ function removeOldTraceLogs($conn, $config, $s_deleteTraceLogOlderThanMinutes) { output($status_code_DbIssue, 'could not remove old trace logs'); exit(1); } + + addToDebugTimings("after deleting old trace logs"); } else if ($deleteTraceLogOlderThanMinutes === 0){ + addToDebugTimings("before deleting all old trace logs"); + $sql = "DELETE FROM `" . $tableName . "`;"; $params = array( ':olderThan' => $deleteTraceLogOlderThanMinutes @@ -121,6 +131,8 @@ function removeOldTraceLogs($conn, $config, $s_deleteTraceLogOlderThanMinutes) { output($status_code_DbIssue, 'could not remove all old trace logs'); exit(1); } + + addToDebugTimings("after deleting all old trace logs"); } }