Skip to content

Commit b64acdd

Browse files
luocooongjnturton
authored andcommitted
Try and reduce the vm crash on fork
Use the drop_caches and split unit tests Ready for the review
1 parent af493aa commit b64acdd

File tree

8 files changed

+45
-21
lines changed

8 files changed

+45
-21
lines changed

.github/workflows/ci.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,20 @@ jobs:
4646
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
4747
restore-keys: |
4848
${{ runner.os }}-maven-
49-
# Caches MySQL directory used for JDBC storage plugin tests
50-
- name: Cache MySQL
51-
uses: actions/cache@v2
52-
with:
53-
path: ~/.embedmysql
54-
key: ${{ runner.os }}-mysql
55-
- name: Set up JDK ${{ matrix.java }}
56-
uses: actions/setup-java@v2
57-
with:
58-
distribution: 'adopt'
59-
java-version: ${{ matrix.java }}
6049
- name: Build and test
6150
# The total GitHub Actions memory is 7000Mb. But GitHub CI requires some memory for the container to perform tests
6251
run: |
6352
MAVEN_OPTS="-XX:+UseG1GC"
64-
mvn install --batch-mode --no-transfer-progress -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 # -X -V for debugging
53+
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches' && \
54+
mvn install --batch-mode --no-transfer-progress \
55+
-DexcludedGroups=org.apache.drill.categories.EasyOutOfMemory \
56+
-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
57+
- name: Test Specific Categories # EasyOutOfMemory
58+
run: |
59+
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches' && \
60+
mvn test -pl org.apache.drill.exec:drill-java-exec \
61+
-Dgroups=org.apache.drill.categories.EasyOutOfMemory \
62+
-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
6563
6664
checkstyle_protobuf:
6765
name: Run checkstyle and generate protobufs

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ install:
7373
# For protobuf phase: builds Drill project, performs license checkstyle goal and regenerates Java and C++ Protobuf files
7474
- |
7575
if [ $PHASE = "tests" ]; then \
76-
mvn install --batch-mode --no-transfer-progress -DforkCount=1 -DdirectMemoryMb=$DIRECTMEMORYMB \
76+
mvn install --batch-mode --no-transfer-progress -DdirectMemoryMb=$DIRECTMEMORYMB \
7777
-DexcludedGroups="org.apache.drill.categories.SlowTest,org.apache.drill.categories.UnlikelyTest,org.apache.drill.categories.SecurityTest"; \
7878
elif [ $PHASE = "build_checkstyle_protobuf" ]; then \
7979
MAVEN_OPTS="-Xms1G -Xmx1G" mvn install --no-transfer-progress -Drat.skip=false -Dlicense.skip=false --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -DskipTests=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true && \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.drill.categories;
19+
20+
/**
21+
* Split the unit test for EasyOutOfMemory categories.<br/>
22+
* Note: If you use this category to mark the test class,
23+
* the CI will use a new clean JVM to test them.
24+
*
25+
*/
26+
public interface EasyOutOfMemory extends FlakyTest {
27+
28+
}

common/src/test/java/org/apache/drill/categories/package-info.java

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* <li>{@link org.apache.drill.categories.SlowTest}: These tests run slowly, and are disabled by default.</li>
2626
* <li>{@link org.apache.drill.categories.UnlikelyTest}: These tests represent corner cases, specific bug fixes, or tests for pieces of code that are unlikely to be changed.
2727
* These are disabled by default</li>
28+
* <li>{@link org.apache.drill.categories.FlakyTest}: A category for tests that intermittently fail.</li>
29+
* <li>{@link org.apache.drill.categories.EasyOutOfMemory}: Inherited class FlakyTest and allow the CI tool uses a new JVM to test the unit.</li>
2830
* </ul>
2931
* </p>
3032
* <p>

exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.apache.drill.exec.record.RecordBatchLoader;
3232
import org.apache.drill.exec.record.VectorWrapper;
3333
import org.apache.drill.exec.util.Text;
34+
import org.apache.drill.categories.EasyOutOfMemory;
3435
import org.apache.drill.categories.OperatorTest;
3536
import org.apache.drill.categories.PlannerTest;
3637
import org.apache.drill.categories.SqlFunctionTest;
@@ -68,7 +69,7 @@
6869
import static org.junit.Assert.assertTrue;
6970
import static org.junit.Assert.fail;
7071

71-
@Category({SqlFunctionTest.class, OperatorTest.class, PlannerTest.class})
72+
@Category({ SqlFunctionTest.class, OperatorTest.class, PlannerTest.class, EasyOutOfMemory.class })
7273
public class TestAggregateFunctions extends ClusterTest {
7374

7475
@Rule

exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestParquetWriter.java

-5
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
import org.junit.experimental.categories.Category;
5353
import org.junit.runner.RunWith;
5454
import org.junit.runners.Parameterized;
55-
import org.junit.jupiter.api.condition.DisabledOnOs;
56-
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
57-
import org.junit.jupiter.api.condition.OS;
5855

5956
import java.io.File;
6057
import java.io.FileWriter;
@@ -1003,8 +1000,6 @@ public void testTPCHReadWriteGzip() throws Exception {
10031000
// Only attempt this test on Linux / amd64 because com.rdblue.brotli-codec
10041001
// only bundles natives for Mac and Linux on AMD64. See PARQUET-1975.
10051002
@Test
1006-
@EnabledIfSystemProperty(named = "os.arch", matches = "(amd64|x86_64)")
1007-
@DisabledOnOs({ OS.WINDOWS })
10081003
public void testTPCHReadWriteBrotli() throws Exception {
10091004
try {
10101005
client.alterSession(ExecConstants.PARQUET_WRITER_COMPRESSION_TYPE, "brotli");

exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class TestDrillbitResilience extends ClusterTest {
117117
private static final int NUM_RUNS = 3;
118118
private static final int PROBLEMATIC_TEST_NUM_RUNS = 3;
119119
private static final int TIMEOUT = 15;
120-
private final static Level CURRENT_LOG_LEVEL = Level.DEBUG;
120+
private final static Level CURRENT_LOG_LEVEL = Level.INFO;
121121

122122
/**
123123
* Note: Counting sys.memory executes a fragment on every drillbit. This is a better check in comparison to

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<codemodel.version>2.6</codemodel.version>
117117
<joda.version>2.10.5</joda.version>
118118
<javax.el.version>3.0.0</javax.el.version>
119-
<surefire.version>3.0.0-M5</surefire.version>
119+
<surefire.version>3.0.0-M7</surefire.version>
120120
<jna.version>5.8.0</jna.version>
121121
<commons.compress.version>1.21</commons.compress.version>
122122
<hikari.version>4.0.3</hikari.version>

0 commit comments

Comments
 (0)