activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] TomasHofman commented on a change in pull request #2287: ARTEMIS-2069 Backup doesn't activate after shared store is reconnected
Date Tue, 29 Jan 2019 15:24:02 GMT
TomasHofman commented on a change in pull request #2287: ARTEMIS-2069 Backup doesn't activate
after shared store is reconnected
URL: https://github.com/apache/activemq-artemis/pull/2287#discussion_r251879550
 
 

 ##########
 File path: tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FileLockNodeManagerTest.java
 ##########
 @@ -0,0 +1,75 @@
+package org.apache.activemq.artemis.tests.extras.byteman;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.activemq.artemis.core.server.impl.FileLockNodeManager;
+import org.jboss.byteman.contrib.bmunit.BMRule;
+import org.jboss.byteman.contrib.bmunit.BMRules;
+import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(BMUnitRunner.class)
+public class FileLockNodeManagerTest {
+
+    private static final int TIMEOUT_TOLERANCE = 50;
+
+    private File sharedDir;
+
+    public FileLockNodeManagerTest() throws IOException {
+        sharedDir = File.createTempFile("shared-dir", "");
+        sharedDir.delete();
+        Assert.assertTrue(sharedDir.mkdir());
+
+    }
+
+    @Test
+    @BMRules(
+            rules = {@BMRule(
+                    name = "throw IOException during activation",
+                    targetClass = "org.apache.activemq.artemis.core.server.impl.FileLockNodeManager",
+                    targetMethod = "tryLock",
+                    targetLocation = "AT ENTRY",
+                    action = "THROW new IOException(\"IO Error\");")
+            })
+    public void test() throws Exception {
+        measureLockAcquisisionTimeout(100); // warm-up
+
+        assertMeasuredTimeoutFor(100);
+        assertMeasuredTimeoutFor(120);
+        assertMeasuredTimeoutFor(200);
+//        assertMeasuredTimeoutFor(1000);
 
 Review comment:
   Done.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message