< prev index next >

bots/bridgekeeper/src/test/java/org/openjdk/skara/bots/bridgekeeper/PullRequestPrunerBotTests.java

Print this page
@@ -31,11 +31,11 @@
  
  import static org.junit.jupiter.api.Assertions.assertEquals;
  
  class PullRequestPrunerBotTests {
      @Test
-     void close(TestInfo testInfo) throws IOException {
+     void close(TestInfo testInfo) throws IOException, InterruptedException {
          try (var credentials = new HostCredentials(testInfo);
               var tempFolder = new TemporaryDirectory()) {
              var author = credentials.getHostedRepository();
              var bot = new PullRequestPrunerBot(author, Duration.ofMillis(1));
  

@@ -47,10 +47,13 @@
              // Make a change with a corresponding PR
              var editHash = CheckableRepository.appendAndCommit(localRepo);
              localRepo.push(editHash, author.url(), "edit", true);
              var pr = credentials.createPullRequest(author, "master", "edit", "This is a pull request");
  
+             // Make sure the timeout expires
+             Thread.sleep(100);
+ 
              // Let the bot see it
              TestBotRunner.runPeriodicItems(bot);
  
              // There should now be no open PRs
              var prs = author.pullRequests();
< prev index next >