Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-30634

Git detects all files as having changed on Windows causing burn_in_tests task to time out in Evergreen

    • Fully Compatible
    • Windows
    • v3.6, v3.4
    • TIG 2017-10-23, TIG 2017-11-13, TIG 2017-12-04

      See this Evergreen task timeout as an example.

      My initial suspicion was that core.autocrlf wasn't being set to true when we cloned repositories in Evergreen on Windows, so I tried out the following patch in an Evergreen patch build. Had I tested it out locally, I would have immediately found out that specifying the --name-only to git diff causes it to ignore the --ignore-space-at-eol option and still display the names of files whose only changes are LF -> CRLF. (git diff --ignore-space-at-eol correctly generates no output though.)

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      diff --git a/buildscripts/burn_in_tests.py b/buildscripts/burn_in_tests.py
      index a78c905f97..4251a11c07 100644
      --- a/buildscripts/burn_in_tests.py
      +++ b/buildscripts/burn_in_tests.py
      @@ -175,7 +175,13 @@ def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, ch
                     "the --maxRevisions option."
               return changed_tests
      
      -    changed_files = callo(["git", "diff", "--name-only", base_commit]).splitlines()
      +    changed_files = callo(["git",
      +                           "diff",
      +                           "--name-only",
      +                           # We specify --ignore-space-at-eol to avoid considering a file changed on
      +                           # Windows simply because core.autocrlf isn't set to true.
      +                           "--ignore-space-at-eol",
      +                           base_commit]).splitlines()
           # New files ("untracked" in git terminology) won't show up in the git diff results.
           untracked_files = callo(["git", "status", "--porcelain"]).splitlines()
      
      

      Further investigation is still needed, but I'm filing this ticket so that we can temporarily disable the burn_in_tests task on the "Windows 2008R2 DEBUG" builder rather than reverting the changes from SERVER-30565. The changes from SERVER-30565 are still desirable to avoid causing the compile task to fail when the Evergreen API server isn't available.

            Assignee:
            yves.duhem Yves Duhem
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: