Skip to content

Commit b517c63

Browse files
Override uId and gId for Tar in test
We can not use posix mode because of mTime can have nanoseconds Test can fail on OS with user ID as long, eg: java.lang.IllegalArgumentException: user id '604932503' is too big ( > 2097151 ).
1 parent ed5cc7a commit b517c63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/java/org/codehaus/plexus/archiver/zip/ZipArchiverTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import org.codehaus.plexus.archiver.exceptions.EmptyArchiveException;
6161
import org.codehaus.plexus.archiver.tar.TarArchiver;
6262
import org.codehaus.plexus.archiver.tar.TarFile;
63+
import org.codehaus.plexus.archiver.tar.TarLongFileMode;
6364
import org.codehaus.plexus.archiver.util.ArchiveEntryUtils;
6465
import org.codehaus.plexus.archiver.util.DefaultArchivedFileSet;
6566
import org.codehaus.plexus.archiver.util.DefaultFileSet;
@@ -809,6 +810,10 @@ public void testZipNonConcurrentResourceCollection()
809810
{
810811
final File tarFile = getTestFile( "target/output/zip-non-concurrent.tar" );
811812
TarArchiver tarArchiver = (TarArchiver) lookup( Archiver.class, "tar" );
813+
// Override uId and gId - in standard mode on OS where uId or gId can have long values creation of tar can fail
814+
// We can not use posix mode because mTime can have nanoseconds in posix but zip doesn't so assertions can fail
815+
tarArchiver.setOverrideUid(100);
816+
tarArchiver.setOverrideGid(100);
812817
tarArchiver.setDestFile( tarFile );
813818
// We're testing concurrency issue so we need large amount of files
814819
for ( int i = 0; i < 100; i++ )

0 commit comments

Comments
 (0)