Skip to content

Commit 1b29c98

Browse files
committed
HADOOP-19726. For Test.
1 parent 9ba2bc5 commit 1b29c98

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

hadoop-cloud-storage-project/hadoop-tos/pom.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,52 @@
191191
</plugin>
192192
</plugins>
193193
</build>
194+
195+
<profiles>
196+
<profile>
197+
<id>parallel-tests</id>
198+
<build>
199+
<plugins>
200+
<plugin>
201+
<groupId>org.apache.hadoop</groupId>
202+
<artifactId>hadoop-maven-plugins</artifactId>
203+
<executions>
204+
<execution>
205+
<id>parallel-tests-createdir</id>
206+
<goals>
207+
<goal>parallel-tests-createdir</goal>
208+
</goals>
209+
</execution>
210+
</executions>
211+
</plugin>
212+
<plugin>
213+
<groupId>org.apache.maven.plugins</groupId>
214+
<artifactId>maven-surefire-plugin</artifactId>
215+
<configuration>
216+
<forkCount>${testsThreadCount}</forkCount>
217+
<reuseForks>false</reuseForks>
218+
<argLine>${maven-surefire-plugin.argLine}</argLine>
219+
<systemPropertyVariables>
220+
<testsThreadCount>${testsThreadCount}</testsThreadCount>
221+
<test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
222+
<test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
223+
<hadoop.tmp.dir>${project.build.directory}/test/${surefire.forkNumber}</hadoop.tmp.dir>
224+
<!-- This is intentionally the same directory for all JUnit -->
225+
<!-- forks, for use in the very rare situation that -->
226+
<!-- concurrent tests need to coordinate, such as using lock -->
227+
<!-- files. -->
228+
<test.build.shared.data>${test.build.data}</test.build.shared.data>
229+
230+
<!-- Due to a Maven quirk, setting this to just -->
231+
<!-- surefire.forkNumber won't do the parameter substitution. -->
232+
<!-- Putting a prefix in front of it like "fork-" makes it -->
233+
<!-- work. -->
234+
<test.unique.fork.id>fork-${surefire.forkNumber}</test.unique.fork.id>
235+
</systemPropertyVariables>
236+
</configuration>
237+
</plugin>
238+
</plugins>
239+
</build>
240+
</profile>
241+
</profiles>
194242
</project>

hadoop-cloud-storage-project/hadoop-tos/src/test/java/org/apache/hadoop/fs/tosfs/object/TestObjectMultiRangeInputStream.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public void testSequentialAndRandomRead() throws IOException {
107107
in.seek(2 << 20);
108108
assertEquals(2 << 20, in.getPos());
109109
assertEquals((4 << 20) + 1024, in.nextExpectPos());
110-
assertEquals((4 << 20) + 1024, in.nextExpectPos());
111110

112111
readCnt = in.read(b);
113112
assertEquals(readCnt, b.length);

0 commit comments

Comments
 (0)