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

[test] Prevent hard-coded path #644

Closed

Conversation

guusdk
Copy link
Member

@guusdk guusdk commented Nov 4, 2024

The hardcoded path used in this test conflicts with a pre-existing path by another user/process. This commit adds a bit of randomness to the directory name, similar to that used in OXInstantMessagingManagerTest

Fixes SMACK-955

The hardcoded path used in this test conflicts with a pre-existing path by another user/process. This commit adds a bit of randomness to the directory name, similar to that used in `OXInstantMessagingManagerTest`

Fixes SMACK-955
@guusdk guusdk force-pushed the SMACK-955_Hardcoded-tmp-path branch from d5fe94f to c2c695d Compare November 4, 2024 18:49
@@ -51,7 +52,7 @@ public class SecretKeyBackupHelperTest extends SmackTestSuite {
private static final File basePath;

static {
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys");
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys_" + StringUtils.randomString(10));
Copy link
Member

Choose a reason for hiding this comment

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

Let's do the idiomatic thing:

Suggested change
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys_" + StringUtils.randomString(10));
basePath = Files.createTempDirectory("ox_secret_keys").toFile();

Copy link
Member

Choose a reason for hiding this comment

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

Could we please move this PR along so that we can get ignite's bamboo jobs green again, thanks.

@guusdk
Copy link
Member Author

guusdk commented Nov 15, 2024 via email

@Flowdalic
Copy link
Member

Fixed with 2e4178d

@Flowdalic Flowdalic closed this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants