MantisBT - CMake
View Issue Details
0014581CMakeCTestpublic2013-11-19 05:442015-11-02 09:13
David Weese 
 
highmajoralways
closednot fixable 
AppleMacOS X 10.9
CMake 2.8.12 
 
0014581: The git module of CTest doesn't use the nightly timestamp for git update
The Git module of CTest doesn't use the nightly timestamp for git update. Instead always the branch is updated to the current HEAD.

As a consequence, nightly builds that were launched later at the same day, e.g. because they were executed one after another, possibly use a different state of the repository.

That behavior is different from the Subversion module where in case of the CTEST_MODEL=Nightly a night-timestamp is used for the update.
The current SVN module of CTest looks as follows (cmake/Source/CTest/cmCTestSVN.cxx:282-286):

  // Specify the start time for nightly testing.
  if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
  {
    args.push_back("-r{" + this->GetNightlyTime() + " +0000}");
  }

The corresponding UpdateImpl function for GIT is located at cmake/Source/CTest/cmCTestGIT.cxx:266-293. However, in the whole cpp file there is no call of GetTestModel() and occurrence of cmCTest::NIGHTLY.
No tags attached.
related to 0015512closed  Fix CTEST_GIT_UPDATE_CUSTOM documentation 
Issue History
2013-11-19 05:44David WeeseNew Issue
2013-11-19 08:28Brad KingNote Added: 0034477
2015-04-13 08:59trsystranNote Added: 0038489
2015-04-13 09:20Brad KingNote Added: 0038491
2015-04-13 09:27trsystranNote Added: 0038492
2015-04-13 09:29Brad KingStatusnew => resolved
2015-04-13 09:29Brad KingResolutionopen => not fixable
2015-04-13 12:49Brad KingRelationship addedrelated to 0015512
2015-11-02 09:13Robert MaynardNote Added: 0039765
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0034477)
Brad King   
2013-11-19 08:28   
This is intentional. The idea of a nightly start time cannot be implemented client-side for Git. There is no way for a client to know where a particular remote branch pointed as of the nightly start time. This is the nature of DVCS. One could create a commit prior to the nightly start time but not push it until after the nightly start time and then test clients would still not get a consistent version.

CMake itself solves this problem with a dedicated server-side branch. We use a scheduled task that runs exactly at the nightly start time to update a server-side branch (e.g. nightly-master) to wherever the corresponding branch (e.g. master) is as of that time. Then CTest clients follow the "nightly" branch to get a consistent version.
(0038489)
trsystran   
2015-04-13 08:59   
What about trying to over the case where all nightly builds start approximately at the same time and during that time the referenced branch name is not moved around? This is a fairly standard case, and it behaves like SVN: in this case we *can* define a nightly time globally.

If the prerequisites are fulfilled, then it will work. Otherwise it won't work as expected. (It currently never works as expected...)

We could add an option for the CTest user to set when he can guarantee the prerequisites.
This won't break any existing setup, and would improve GIT support with this new option.
(0038491)
Brad King   
2015-04-13 09:20   
Re 0014581:0038489: If all the clients start during a period when the branch is not moving, why is special support needed at all? In that case just updating to the current branch head is sufficient.

FWIW the existing behavior is now documented here:

 http://www.cmake.org/cmake/help/v3.2/manual/ctest.1.html#ctest-update-step [^]
 NightlyStartTime: ... This is not well-defined in distributed version-control systems so the setting is ignored.
(0038492)
trsystran   
2015-04-13 09:27   
My scenario allows commits being added to a branch during the ctest start period, it just requires the branch to go forward, which may be a common case.

But indeed this adds complexity for a thin benefit in covered use-cases.

Now that it's documented it's OK. I didn't saw this.
(0039765)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.