Skip to content

Commit 96fd784

Browse files
committed
[OPENJDK-2288] Update OpenJDKTestParent.java to cast ArchiveOutputStream to TarArchiveOutputStream and setBigNumberMode mode to allow for very large UIDs that are likely when executing on OpenShift.
1 parent 89ca565 commit 96fd784

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test-openjdk/src/test/java/com/redhat/qe/openjdk/OpenJDKTestParent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.apache.commons.compress.archivers.ArchiveOutputStream;
77
import org.apache.commons.compress.archivers.ArchiveStreamFactory;
88
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
9+
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
910
import org.apache.commons.io.FileUtils;
1011
import org.apache.commons.io.IOUtils;
1112
import org.apache.commons.io.filefilter.TrueFileFilter;
@@ -132,7 +133,7 @@ public static Build startBinaryBuild(final String bcName, Path sources) throws I
132133
ExecutorService executorService = Executors.newSingleThreadExecutor();
133134
final Future<?> future = executorService.submit(() -> {
134135
Collection<File> filesToArchive = FileUtils.listFiles(sources.toFile(), TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
135-
try (ArchiveOutputStream o = new ArchiveStreamFactory().createArchiveOutputStream(ArchiveStreamFactory.TAR, pos)) {
136+
try (TarArchiveOutputStream o = (TarArchiveOutputStream) new ArchiveStreamFactory().createArchiveOutputStream(ArchiveStreamFactory.TAR, pos)) {
136137
for (File f : filesToArchive) {
137138
String tarPath = sources.relativize(f.toPath()).toString();
138139
log.trace("adding file to tar: {}", tarPath);
@@ -142,6 +143,7 @@ public static Build startBinaryBuild(final String bcName, Path sources) throws I
142143
TarArchiveEntry tarArchiveEntry = (TarArchiveEntry)entry;
143144
tarArchiveEntry.setModTime(Date.from(Instant.EPOCH));
144145

146+
o.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
145147
o.putArchiveEntry(tarArchiveEntry);
146148
if (f.isFile()) {
147149
try (InputStream i = Files.newInputStream(f.toPath())) {

0 commit comments

Comments
 (0)