You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/02/20 10:27:34 UTC

[GitHub] ivankelly closed pull request #1122: [WIP] Jenkins bc

ivankelly closed pull request #1122: [WIP] Jenkins bc
URL: https://github.com/apache/bookkeeper/pull/1122
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.test-infra/jenkins/common_job_properties.groovy b/.test-infra/jenkins/common_job_properties.groovy
index 7ff5fe1ff..553e2db8b 100644
--- a/.test-infra/jenkins/common_job_properties.groovy
+++ b/.test-infra/jenkins/common_job_properties.groovy
@@ -43,7 +43,7 @@ class common_job_properties {
                                            String branch = 'master',
                                            String jdkVersion = 'JDK 1.8 (latest)',
                                            int timeout = 200,
-                                           String jenkinsExecutorLabel = 'ubuntu') {
+                                           String jenkinsExecutorLabel = 'ubuntu && !H27') {
     // GitHub project.
     context.properties {
       githubProjectUrl('https://github.com/apache/bookkeeper/')
@@ -181,7 +181,8 @@ class common_job_properties {
   static void setMavenConfig(context, mavenInstallation='Maven 3.5.0', mavenOpts='-Xmx4096m -Xms2048m') {
     context.mavenInstallation(mavenInstallation)
     context.mavenOpts('-Dorg.slf4j.simpleLogger.showDateTime=true')
-    context.mavenOpts('-Dorg.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd\\\'T\\\'HH:mm:ss.SSS')
+        context.mavenOpts('-Dorg.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd\\\'T\\\'HH:mm:ss.SSS')
+
     // The -XX:+TieredCompilation -XX:TieredStopAtLevel=1 JVM options enable
     // tiered compilation to make the JVM startup times faster during the tests.
     context.mavenOpts('-XX:+TieredCompilation')
diff --git a/.test-infra/jenkins/job_jenkinstesting_bookkeeper_precommit_integrationtests.groovy b/.test-infra/jenkins/job_jenkinstesting_bookkeeper_precommit_integrationtests.groovy
new file mode 100644
index 000000000..78de12a28
--- /dev/null
+++ b/.test-infra/jenkins/job_jenkinstesting_bookkeeper_precommit_integrationtests.groovy
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import common_job_properties
+
+// This is the Java precommit which runs a maven install, and the current set of precommit tests.
+freeStyleJob('bookkeeper_precommit_integrationtests') {
+    description('precommit integration test verification for pull requests of <a href="http://bookkeeper.apache.org">Apache BookKeeper</a>.')
+
+    // Set common parameters.
+    common_job_properties.setTopLevelMainJobProperties(
+        delegate,
+        'master',
+        'JDK 1.8 (latest)',
+        120)
+
+    steps {
+        // Temporary information gathering to see if full disks are causing the builds to flake
+        shell('id')
+        shell('ulimit -a')
+        shell('pwd')
+        shell('df -h')
+        shell('ps -eo euser,pid,ppid,pgid,start,pcpu,pmem,cmd')
+        shell('docker system events > docker.log & echo $! > docker-log.pid')
+
+        shell('docker pull apachebookkeeper/bookkeeper-all-released-versions:latest')
+
+        // Build everything
+        maven {
+            // Set Maven parameters.
+            common_job_properties.setMavenConfig(delegate)
+
+            goals('-B clean install -Pdocker')
+            properties(skipTests: true, interactiveMode: false)
+        }
+
+        maven {
+            // Set Maven parameters.
+            common_job_properties.setMavenConfig(delegate)
+            rootPOM('tests/pom.xml')
+            goals('-B test -DintegrationTests')
+        }
+
+        shell('kill $(cat docker-log.pid) || true')
+    }
+
+    publishers {
+        archiveArtifacts {
+            allowEmpty(true)
+            pattern('**/target/container-logs/**')
+            pattern('docker.log')
+        }
+        archiveJunit('**/surefire-reports/TEST-*.xml')
+    }
+}
diff --git a/.travis.yml b/.travis.yml
index 353abd233..5e0c4b0eb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,7 +33,10 @@ matrix:
       env: CUSTOM_JDK="oraclejdk9"
     - os: linux
       dist: trusty
-      env: CUSTOM_JDK="openjdk8"
+      sudo: true
+      env:
+        - CUSTOM_JDK="openjdk8"
+        - DOCKER="yes"
 
 before_install:
 - |
@@ -57,6 +60,7 @@ before_install:
 
 script:
   - travis_retry mvn --batch-mode clean apache-rat:check compile spotbugs:check install -DskipTests
+  - if [ "$DOCKER" == "yes" ]; then mvn --batch-mode -f tests/pom.xml install -DintegrationTests; fi
   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then dev/check-binary-license ./bookkeeper-dist/all/target/bookkeeper-all-${BK_VERSION}-bin.tar.gz; fi
   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then dev/check-binary-license ./bookkeeper-dist/server/target/bookkeeper-server-${BK_VERSION}-bin.tar.gz; fi
   - if [ "$DLOG_MODIFIED" == "true" ]; then cd stream/distributedlog && mvn --batch-mode clean package -Ddistributedlog; fi
diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperClusterUtils.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperClusterUtils.java
index a7f9f8c03..c8418249a 100644
--- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperClusterUtils.java
+++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperClusterUtils.java
@@ -192,7 +192,18 @@ public static boolean stopBookie(DockerClient docker, String containerId) {
             LOG.error("Exception stopping bookie", e);
             return false;
         }
-        return waitBookieDown(docker, containerId, 5, TimeUnit.SECONDS);
+        if (waitBookieDown(docker, containerId, 5, TimeUnit.SECONDS)) {
+            return true;
+        } else {
+            LOG.error("Bookie didn't go down (deregister from zk) after 5 seconds, dumping process list");
+            try {
+                DockerUtils.runCommand(docker, containerId, "ps", "-ef");
+                DockerUtils.runCommand(docker, containerId, "supervisorctl", "status");
+            } catch (Exception e) {
+                LOG.error("Exception dumping container processes", e);
+            }
+            return false;
+        }
     }
 
     public static boolean stopAllBookies(DockerClient docker) {
diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/DockerUtils.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/DockerUtils.java
index 11959afe7..293ea3683 100644
--- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/DockerUtils.java
+++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/DockerUtils.java
@@ -133,7 +133,8 @@ public static String getContainerIP(DockerClient docker, String containerId) {
 
     public static void runCommand(DockerClient docker, String containerId, String... cmd) throws Exception {
         CompletableFuture<Boolean> future = new CompletableFuture<>();
-        String execid = docker.execCreateCmd(containerId).withCmd(cmd).exec().getId();
+        String execid = docker.execCreateCmd(containerId).withCmd(cmd)
+            .withAttachStderr(true).withAttachStdout(true).exec().getId();
         String cmdString = Arrays.stream(cmd).collect(Collectors.joining(" "));
         docker.execStartCmd(execid).withDetach(false).exec(new ResultCallback<Frame>() {
                 @Override
@@ -146,7 +147,12 @@ public void onStart(Closeable closeable) {
 
                 @Override
                 public void onNext(Frame object) {
-                    LOG.info("DOCKER.exec({}:{}): {}", containerId, cmdString, object);
+                    LOG.info("DOCKER.exec({}:{}): DOING SOMEHTING", containerId, cmdString);
+                    try {
+                        LOG.info("DOCKER.exec({}:{}): {}", containerId, cmdString, object);
+                    } catch (Exception e) {
+                        LOG.error("DOCKER.exec eror", e);
+                    }
                 }
 
                 @Override
diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/MavenClassLoader.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/MavenClassLoader.java
index 6f31f5c76..8283ca6c0 100644
--- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/MavenClassLoader.java
+++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/MavenClassLoader.java
@@ -68,6 +68,10 @@ public static MavenClassLoader forArtifact(String mainArtifact) throws Exception
 
         File[] files = Maven.resolver().addDependencies(deps.toArray(new MavenDependency[0]))
             .resolve().withTransitivity().asFile();
+        LOG.info("IKDEBUG Loading files for {}", mainArtifact);
+        for (File f : files) {
+            LOG.info("IKDEBUG - {}", f.toString());
+        }
         URLClassLoader cl = AccessController.doPrivileged(
                 new PrivilegedAction<URLClassLoader>() {
                     @Override


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services