Skip to content

Commit

Permalink
Include a maximum timeout for PrefetchVerbTests of ~50 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickstolee committed Oct 11, 2018
1 parent 26e67c3 commit 946b944
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class PrefetchVerbTests : TestsWithEnlistmentPerFixture

private FileSystemRunner fileSystem;

public PrefetchVerbTests()
public PrefetchVerbTests() : base(skipPrefetchDuringClone: true)
{
this.fileSystem = new SystemIORunner();
}
Expand Down Expand Up @@ -133,11 +133,12 @@ private void PostFetchJobShouldComplete()

// Wait first, to hopefully ensure the background thread has
// started before we check for the lock file.
int timeoutCount = 0;
do
{
Thread.Sleep(500);
}
while (this.fileSystem.FileExists(postFetchLock));
while (this.fileSystem.FileExists(postFetchLock) && ++timeoutCount < 100);

ProcessResult midxResult = GitProcess.InvokeProcess(this.Enlistment.RepoRoot, "midx --read --pack-dir=\"" + objectDir + "/pack\"");
midxResult.ExitCode.ShouldEqual(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,12 @@ private void PostFetchJobShouldComplete()
string objectDir = this.Enlistment.GetObjectRoot(this.fileSystem);
string postFetchLock = Path.Combine(objectDir, "post-fetch.lock");

while (this.fileSystem.FileExists(postFetchLock))
int timeoutCount = 0;
do
{
Thread.Sleep(500);
}
while (this.fileSystem.FileExists(postFetchLock) && ++timeoutCount < 100);

ProcessResult midxResult = GitProcess.InvokeProcess(this.Enlistment.RepoRoot, "midx --read --pack-dir=\"" + objectDir + "/pack\"");
midxResult.ExitCode.ShouldEqual(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public virtual void CreateEnlistment()
}
else
{
this.Enlistment = GVFSFunctionalTestEnlistment.CloneAndMount(GVFSTestConfig.PathToGVFS);
this.Enlistment = GVFSFunctionalTestEnlistment.CloneAndMount(GVFSTestConfig.PathToGVFS, skipPrefetch: this.skipPrefetchDuringClone);
}
}

Expand Down

0 comments on commit 946b944

Please sign in to comment.