Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override uId and gId for Tar in test #264

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

slawekjaranowski
Copy link
Member

@slawekjaranowski slawekjaranowski commented Apr 17, 2023

Test can fail on OS with user ID as long, eg:
java.lang.IllegalArgumentException: user id '604932503' is too big ( > 2097151 ).

We can not use posix mode because mTime in Tar can have nanoseconds in posix but Zip doesn't so assertions can fail

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 ).
@slawekjaranowski slawekjaranowski changed the title Use posix mode for Tar in test Override uId and gId for Tar in test Apr 19, 2023
@@ -809,6 +810,10 @@ public void testZipNonConcurrentResourceCollection()
{
final File tarFile = getTestFile( "target/output/zip-non-concurrent.tar" );
TarArchiver tarArchiver = (TarArchiver) lookup( Archiver.class, "tar" );
// Override uId and gId - in standard mode on OS where uId or gId can have long values creation of tar can fail
// We can not use posix mode because mTime can have nanoseconds in posix but zip doesn't so assertions can fail
tarArchiver.setOverrideUid(100);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests the zip file creation from resource collection so not getting the uid/gui from the filesystem should not affect what is asserted. But I wonder how tar tests are not failing then. They should test if the uid is correct.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In tar tests posix mode is used.

But here also timestamp is compared. Looks like in zip nanoseconds are dropped.

@plamentotev plamentotev requested review from plamentotev and removed request for plamentotev April 20, 2023 17:47
@slawekjaranowski slawekjaranowski merged commit b517c63 into codehaus-plexus:master Apr 21, 2023
@slawekjaranowski slawekjaranowski deleted the tar-posix branch April 21, 2023 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants