mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 20:00:38 -06:00
committed by
Brad King
parent
1c12694124
commit
5d178fcc53
@@ -1608,6 +1608,7 @@ syn keyword cmakeVariable contained
|
||||
\ CTEST_SCP_COMMAND
|
||||
\ CTEST_SITE
|
||||
\ CTEST_SOURCE_DIRECTORY
|
||||
\ CTEST_SUBMIT_INACTIVITY_TIMEOUT
|
||||
\ CTEST_SUBMIT_URL
|
||||
\ CTEST_SVN_COMMAND
|
||||
\ CTEST_SVN_OPTIONS
|
||||
|
||||
@@ -665,6 +665,7 @@ Variables for CTest
|
||||
/variable/CTEST_SCP_COMMAND
|
||||
/variable/CTEST_SCRIPT_DIRECTORY
|
||||
/variable/CTEST_SITE
|
||||
/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT
|
||||
/variable/CTEST_SUBMIT_URL
|
||||
/variable/CTEST_SOURCE_DIRECTORY
|
||||
/variable/CTEST_SVN_COMMAND
|
||||
|
||||
@@ -1349,6 +1349,13 @@ Configuration settings include:
|
||||
* :module:`CTest` module variable: ``SUBMIT_URL`` if set,
|
||||
else ``CTEST_SUBMIT_URL``
|
||||
|
||||
``SubmitInactivityTimeout``
|
||||
The time to wait for the submission after which it is canceled
|
||||
if not completed. Specify a zero value to disable timeout.
|
||||
|
||||
* `CTest Script`_ variable: :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT`
|
||||
* :module:`CTest` module variable: ``CTEST_SUBMIT_INACTIVITY_TIMEOUT``
|
||||
|
||||
``TriggerSite``
|
||||
Legacy option. Not used.
|
||||
|
||||
|
||||
5
Help/release/dev/ctest_submit-inactivity-timeout.rst
Normal file
5
Help/release/dev/ctest_submit-inactivity-timeout.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
ctest_submit-inactivity-timeout
|
||||
-------------------------------
|
||||
|
||||
* :manual:`ctest(1)` gained a new :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT`
|
||||
variable, which can be used to specify a timeout for submission inactivity.
|
||||
5
Help/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT.rst
Normal file
5
Help/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
CTEST_SUBMIT_INACTIVITY_TIMEOUT
|
||||
-------------------------------
|
||||
|
||||
Specify the CTest ``SubmitInactivityTimeout`` setting
|
||||
in a :manual:`ctest(1)` dashboard client script.
|
||||
@@ -21,6 +21,7 @@ LabelsForSubprojects: @CTEST_LABELS_FOR_SUBPROJECTS@
|
||||
|
||||
# Submission information
|
||||
SubmitURL: @SUBMIT_URL@
|
||||
SubmitInactivityTimeout: @CTEST_SUBMIT_INACTIVITY_TIMEOUT@
|
||||
|
||||
# Dashboard start time
|
||||
NightlyStartTime: @NIGHTLY_START_TIME@
|
||||
|
||||
@@ -58,6 +58,9 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
|
||||
|
||||
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
||||
this->Makefile, "CurlOptions", "CTEST_CURL_OPTIONS", this->Quiet);
|
||||
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
||||
this->Makefile, "SubmitInactivityTimeout",
|
||||
"CTEST_SUBMIT_INACTIVITY_TIMEOUT", this->Quiet);
|
||||
|
||||
cmValue notesFilesVariable =
|
||||
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <cstdlib>
|
||||
#include <sstream>
|
||||
|
||||
#include <cm/iomanip>
|
||||
#include <cmext/algorithm>
|
||||
|
||||
#include <cm3p/curl/curl.h>
|
||||
@@ -216,8 +217,11 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
|
||||
|
||||
// if there is little to no activity for too long stop submitting
|
||||
::curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1);
|
||||
::curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME,
|
||||
SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT);
|
||||
auto submitInactivityTimeout = this->GetSubmitInactivityTimeout();
|
||||
if (submitInactivityTimeout != 0) {
|
||||
::curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME,
|
||||
submitInactivityTimeout);
|
||||
}
|
||||
|
||||
/* HTTP PUT please */
|
||||
::curl_easy_setopt(curl, CURLOPT_PUT, 1);
|
||||
@@ -499,7 +503,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
|
||||
std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
|
||||
std::vector<std::string> args = cmExpandedList(curlopt);
|
||||
curl.SetCurlOptions(args);
|
||||
curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT);
|
||||
auto submitInactivityTimeout = this->GetSubmitInactivityTimeout();
|
||||
if (submitInactivityTimeout != 0) {
|
||||
curl.SetTimeOutSeconds(submitInactivityTimeout);
|
||||
}
|
||||
curl.SetHttpHeaders(this->HttpHeaders);
|
||||
std::string url = this->CTest->GetSubmitURL();
|
||||
if (!cmHasLiteralPrefix(url, "http://") &&
|
||||
@@ -893,6 +900,26 @@ void cmCTestSubmitHandler::SelectParts(std::set<cmCTest::Part> const& parts)
|
||||
}
|
||||
}
|
||||
|
||||
int cmCTestSubmitHandler::GetSubmitInactivityTimeout()
|
||||
{
|
||||
int submitInactivityTimeout = SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT;
|
||||
std::string const& timeoutStr =
|
||||
this->CTest->GetCTestConfiguration("SubmitInactivityTimeout");
|
||||
if (!timeoutStr.empty()) {
|
||||
unsigned long timeout;
|
||||
if (cmStrToULong(timeoutStr, &timeout)) {
|
||||
submitInactivityTimeout = static_cast<int>(timeout);
|
||||
} else {
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
"SubmitInactivityTimeout is invalid: "
|
||||
<< cm::quoted(timeoutStr) << "."
|
||||
<< " Using a default value of "
|
||||
<< SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT << "." << std::endl);
|
||||
}
|
||||
}
|
||||
return submitInactivityTimeout;
|
||||
}
|
||||
|
||||
void cmCTestSubmitHandler::SelectFiles(std::set<std::string> const& files)
|
||||
{
|
||||
this->Files.insert(files.begin(), files.end());
|
||||
|
||||
@@ -63,6 +63,7 @@ private:
|
||||
void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
|
||||
|
||||
std::string GetSubmitResultsPrefix();
|
||||
int GetSubmitInactivityTimeout();
|
||||
|
||||
class ResponseParser;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user