Skip to content

"checkout --unstaged" test is flaky #1334

Closed

Description

@ttaylorr

The test: checkout --unstaged test is flaky. I have not been able to reproduce the failure (yet) on my laptop, but it is currently breaking Travis CI builds on Go 1.6.

Here are some failures:

/cc @orivej could you please take a look at these test and see if you can figure out what's causing them to fail in that particular environment? Thanks!

Activity

  1. orivej commented on Jun 29, 2016

    @orivej
    Contributor

    Still investigating…

    Meanwhile, you should disable git diff-files checks in the checkout --unstaged test as they are only meant to differentiate checkout and checkout --unstaged functionality, and the actual output of git diff-files is not interesting to the user.

  2. javabrett commented on Jun 30, 2016

    @javabrett
    Contributor

    Is git diff-files supposed to be empty, and therefore also not contain the string file1.dat? If the name is not supposed to be there, grep in that case is going to exit 1 and by set -e the test fails. I don't know why it passes sometimes - perhaps git diff-files completes so-fast with no output that bash doesn't even bother to create the pipe and start grep?

    I may be totally misunderstanding the sense of the test - please confirm whether diff-files should be empty (exits 0), and therefore the grep should also fail.

  3. orivej commented on Jun 30, 2016

    @orivej
    Contributor

    The test checks the behaviour of checkout --unstaged command that performs checkout skipping git update-index. Therefore large files should be present only in the working copy and not in the index, and git diff-files will show the difference between the working copy and the index. Normally during this test git diff-files outputs:

    :100644 100644 5731942191cb145b334b73f1a2a5ae4346041780 0000000000000000000000000000000000000000 M  file1.dat
    

    However, due to interaction with the smudge filter that I don't yet understand, after performing some git commands in the checkout, e.g. git status, large files appear to be indexed (and future git diff-files output nothing). Ideally after checkout --unstaged git status and other commands will not affect the apparent state of the index. (Or, even better but unlikely, it is possible to achieve the same result as with checkout without doing git update-index.)

    I have not yet reproduced test failure locally, even with the version of git used in Travis.

  4. ttaylorr commented on Jun 30, 2016

    @ttaylorr
    ContributorAuthor

    @orivej I haven't been able to reproduce it locally either :-(. Are you able to debug from the output of one of the failing tests I listed above?

  5. orivej commented on Jun 30, 2016

    @orivej
    Contributor

    No, Travis output reveals that the test fails because git diff-files outputs nothing, and that's it. The test also does not fail in the quay.io/travisci/travis-go docker image (with go1.6).

    My first priority is to understand why after git status git diff-files outputs nothing, then I expect to be able change git-lfs such that running git status does not affect the state of the index, and then hopefully the test will pass, and also file1.dat will be mentioned by git status.

  6. sinbad commented on Jul 4, 2016

    @sinbad
    Contributor

    This test is failing on my PR too, stopping it from being merged: https://travis-ci.org/github/git-lfs/jobs/142187444

    My guess is that it's timestamp / git version sensitive. The git update-index call is made to ensure that all the cached values in the index are corrected, because of efforts to avoid the 'racy clean' problem in git can make it unreliable if you don't. Given the problems I've seen around this in the past I'm not sure the --unstaged option as added can ever be 100% guaranteed to provide a clean state.

  7. javabrett commented on Jul 4, 2016

    @javabrett
    Contributor

    Last I recall this test was failing in my sandbox build. So if there's debug code or that could be added to diagnose, send it over, although I guess that could equally be added and run in Travis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions