Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-12979

Test file date check not forgiving enough

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Low Low
    • None
    • 6.1.1, 6.4.1
    • Tests

      Summary

      calling file.lastUpdated() on my machine provides you with a time stamp to the nearest second (and seems to always round down). This means that if your build is really fast, the files look like they were updated before the tasks started and therefore Bamboo will not parse them for tests.

      There are also file systems which only store the lastUpdated timestamps to the nearest 2 second.

      We should probably provide some sort of leniency here.

      Solution

      Bamboo uses system property bamboo.fs.timestamp.precision to define FS timestamp resolution. By default it is set to 100 (ms), please set it to higher value in order to make file date check less strict. Bamboo does the check in the following way:

      private boolean isFileRecentEnough(final File file)
      {
        return file.lastModified() >= (taskStartDate.getTime() - SystemProperty.FS_TIMESTAMP_RESOLUTION_MS.getTypedValue());
      }
      

              Unassigned Unassigned
              bmccoy bmccoy
              Votes:
              28 Vote for this issue
              Watchers:
              29 Start watching this issue

                Created:
                Updated:
                Resolved: