Skip to content

Commit

Permalink
Fixing a test problem
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Dec 1, 2015
1 parent 79f86b8 commit 0397d7a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/test/java/org/kohsuke/github/PullRequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,21 @@ public void testPullRequestReviewComments() throws Exception {
@Test
public void testMergeCommitSHA() throws Exception {
String name = rnd.next();
GHPullRequest p = getRepository().createPullRequest(name, "stable", "master", "## test");
GHPullRequest updated = getRepository().getPullRequest(p.getNumber());
GHCommit commit = getRepository().getCommit(updated.getMergeCommitSha());
assertNotNull(commit);
GHPullRequest p = getRepository().createPullRequest(name, "mergeable-branch", "master", "## test");
for (int i=0; i<100; i++) {
GHPullRequest updated = getRepository().getPullRequest(p.getNumber());
if (updated.getMergeCommitSha()!=null) {
// make sure commit exists
GHCommit commit = getRepository().getCommit(updated.getMergeCommitSha());
assertNotNull(commit);
return;
}

// mergeability computation takes time. give it more chance
Thread.sleep(100);
}
// hmm?
fail();
}

@Test
Expand Down

0 comments on commit 0397d7a

Please sign in to comment.