Skip to content
Commit f760d23b authored by Igor Kushnir's avatar Igor Kushnir
Browse files

cmake: hide file API timestamp implementation details

This allows to change the algorithm that determines whether project data
is outdated in a single file - cmakefileapi.cpp.

The check in test_cmakefileapi becomes less strict with this change:
timestamp equality is not a failure anymore. When the timestamps are
equal, CMakeManager did not and still does not consider the project data
outdated, so this change makes the test consistent with non-test code.

This change can fix occasional test_cmakefileapi failures on the CI:
  FAIL!  : TestCMakeFileApi::testConfigure() 'projectData.lastModifiedCMakeFile < projectData.lastModifiedProjectData' returned FALSE. ()
  Loc: [/builds/arkanisgath/kdevelop/plugins/cmake/tests/test_cmakefileapi.cpp(104)]
A possible cause of this failure is the combination of:
1. CMake::FileApi::parseCMakeFiles() takes into account the timestamps
   of generated CMake files, which can be modified during the CMake
   configure step.
2. CMake file API reply index file is always modified during the CMake
   generate step, which always follows the CMake configure step.
   However, timestamp precision on the CI server might be reduced to
   mitigate some vulnerability. And thus these last-modified timestamps
   can occasionally compare equal and cause intermittent test failures.
parent 6cdc4f91
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment