Skip to content

PrefetchVerbTests: Remove commit-graph check#462

Merged
derrickstolee merged 1 commit into
microsoft:masterfrom
derrickstolee:prefetch-test
Nov 2, 2018
Merged

PrefetchVerbTests: Remove commit-graph check#462
derrickstolee merged 1 commit into
microsoft:masterfrom
derrickstolee:prefetch-test

Conversation

@derrickstolee
Copy link
Copy Markdown
Contributor

In the EnlistmentPerFixture.PrefetchVerbTests class, we have the same PostFetchJobShouldComplete() method as we do in the version without a shared cache, except that none of our tests in the class actually trigger a commit-graph write. The commit-graph write requires a prefetch that downloads a new prefetch packfile, while the multi-pack-index is rewritten on every prefetch (in case a non-prefetch packfile was added). We don't write the commit-graph on clone because we need a full enlistment to guarantee missing object downloads.

Somehow, these test succeed in the full test suite, but do not succeed when only the one class is run. This caused some pain for someone stepping through the tests in a debugger.

Instead of removing the commit-graph check, instead see if the commit-graph file exists before calling git commit-graph read. This allows us to still check that the commit-graph file exists and is in good condition (when it exists).

@derrickstolee derrickstolee requested a review from jamill November 2, 2018 12:34
ProcessResult graphResult = GitProcess.InvokeProcess(this.Enlistment.RepoRoot, "commit-graph read --object-dir=\"" + objectDir + "\"");
graphResult.ExitCode.ShouldEqual(0);
graphResult.Output.ShouldContain("43475048"); // Header from commit-graph file.
if (this.fileSystem.FileExists(Path.Combine(objectDir, "info", "commit-graph")))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could include a comment about why this is a conditional check... maybe something along the lines of:

// A commit graph is not always generated, but if it is, then we want to ensure it is in a good state

To indicate to readers why the check is conditional

In the EnlistmentPerFixture.PrefetchVerbTests class, we have the same PostFetchJobShouldComplete() method as we do in the version without a shared cache, except that none of our tests in the class actually trigger a commit-graph write. The commit-graph write requires a prefetch that downloads a new prefetch packfile, while the multi-pack-index is rewritten on every prefetch (in case a non-prefetch packfile was added). We don't write the commit-graph on clone because we need a full enlistment to guarantee missing object downloads.

Somehow, these test succeed in the full test suite, but do not succeed when only the one class is run. This caused some pain for someone stepping through the tests in a debugger.

Instead of removing the commit-graph check, instead see if the commit-graph file exists before calling `git commit-graph read`. This allows us to still check that the commit-graph file exists and is in good condition (when it exists).

The multi-pack-index is guaranteed to exist after every post-fetch job.
@derrickstolee derrickstolee merged commit cec8718 into microsoft:master Nov 2, 2018
@jrbriggs jrbriggs added this to the S147 milestone Feb 7, 2019
@jrbriggs jrbriggs added the type: test-reliability Issues that contribute to test failures label Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: test-reliability Issues that contribute to test failures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants