[java-identity-provider] branch main updated: Try to cope with Windows Defender
Rod Widdowson
rdw at steadingsoftware.com
Tue Apr 19 09:09:44 UTC 2022
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=7943fe526dab1df9352743236c0f37a1f135770d
The following commit(s) were added to refs/heads/main by this push:
new 7943fe526 Try to cope with Windows Defender
7943fe526 is described below
commit 7943fe526dab1df9352743236c0f37a1f135770d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Apr 19 10:06:12 2022 +0100
Try to cope with Windows Defender
WD has a habit of pinning files and not letting go when the file is deleted.
Because of NTFS default semantics (it does not unlink until the file is
deleted unless you tell it to) this leaves the directory non-empty so the
directory delete then fails.
This is just a test so I'll throw in a "wait 10ms and try again" to bodge this.
---
.../java/net/shibboleth/idp/module/IdPModuleTest.java | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java b/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java
index a2a9bd4e0..a368859b9 100644
--- a/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java
+++ b/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java
@@ -24,6 +24,7 @@ import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
+import java.nio.file.DirectoryNotEmptyException;
import java.nio.file.attribute.BasicFileAttributes;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
@@ -56,6 +57,7 @@ import net.shibboleth.utilities.java.support.test.repository.RepositorySupport;
/**
* Unit tests exercising module code.
*/
+ at SuppressWarnings("javadoc")
public class IdPModuleTest {
private static final String XML_DATA = "<test>foo</test>\n";
@@ -88,8 +90,7 @@ public class IdPModuleTest {
context.setHttpClientSecurityParameters(params);
}
- @AfterMethod
- public void tearDown() throws IOException {
+ private void tearDownWorker() throws IOException {
if (testHome != null) {
Files.walkFileTree(testHome, new SimpleFileVisitor<Path>() {
@Override
@@ -114,6 +115,18 @@ public class IdPModuleTest {
testHome = null;
}
}
+
+ @AfterMethod
+ public void tearDown() throws IOException, InterruptedException {
+ try {
+ tearDownWorker();
+ } catch (final DirectoryNotEmptyException ex) {
+ // We hates the Microsoft Defender. (it pins files so directories cannot be deleted)
+ Thread.sleep(10);
+ tearDownWorker();
+ }
+ }
+
@Test
public void testBadModules() {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list