This is an automated email from the ASF dual-hosted git repository.
zhaijia pushed a commit to branch branch-4.5
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/branch-4.5 by this push:
new 9013e92 ISSUE #507: Introduce @FlakyTest annotation for marking a few
tests as flaky
9013e92 is described below
commit 9013e92632e90505bf88d523af1dd520fd809a76
Author: Sijie Guo <[email protected]>
AuthorDate: Fri Nov 10 17:54:35 2017 +0800
ISSUE #507: Introduce @FlakyTest annotation for marking a few tests as flaky
Descriptions of the changes in this PR:
- introduced FlakyTest annotation
- mark a few tests as flaky tests (create issues for them)
Author: Sijie Guo <sijieapache.org>
Reviewers: Jia Zhai <None>
This closes #504 from sijie/mark_test_as_failures, closes #507
Descriptions of the changes in this PR:
(PR description content here)...
Author: Sijie Guo <[email protected]>
Reviewers: Enrico Olivelli <[email protected]>, Jia Zhai <None>, Sijie
Guo <[email protected]>
This closes #710 from ivankelly/flakey-4.5, closes #507
---
.../bookkeeper/client/BookKeeperAdminTest.java | 4 +--
...KeeperDiskSpaceWeightedLedgerPlacementTest.java | 13 ++++----
.../apache/bookkeeper/client/BookKeeperTest.java | 8 -----
.../bookkeeper/test/annotations/FlakyTest.java | 37 ++++++++++++++++++++++
4 files changed, 45 insertions(+), 17 deletions(-)
diff --git
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperAdminTest.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperAdminTest.java
index b197353..d9a812f 100644
---
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperAdminTest.java
+++
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperAdminTest.java
@@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Iterator;
-
import org.apache.bookkeeper.bookie.Bookie;
import org.apache.bookkeeper.client.BKException.BKIllegalOpException;
import org.apache.bookkeeper.client.BookKeeper.DigestType;
@@ -33,6 +32,7 @@ import org.apache.bookkeeper.conf.ServerConfiguration;
import org.apache.bookkeeper.meta.ZkLedgerUnderreplicationManager;
import
org.apache.bookkeeper.replication.ReplicationException.UnavailableException;
import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
+import org.apache.bookkeeper.test.annotations.FlakyTest;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
@@ -103,7 +103,7 @@ public class BookKeeperAdminTest extends
BookKeeperClusterTestCase {
bkAdmin.close();
}
- @Test(timeout = 480000)
+ @FlakyTest("https://github.com/apache/bookkeeper/issues/502")
public void testDecommissionBookie() throws Exception {
ZkLedgerUnderreplicationManager urLedgerMgr = new
ZkLedgerUnderreplicationManager(baseClientConf, zkc);
BookKeeperAdmin bkAdmin = new
BookKeeperAdmin(zkUtil.getZooKeeperConnectString());
diff --git
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperDiskSpaceWeightedLedgerPlacementTest.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperDiskSpaceWeightedLedgerPlacementTest.java
index 3bc612e..7206b23 100644
---
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperDiskSpaceWeightedLedgerPlacementTest.java
+++
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperDiskSpaceWeightedLedgerPlacementTest.java
@@ -34,9 +34,8 @@ import org.apache.bookkeeper.client.BookKeeper.DigestType;
import org.apache.bookkeeper.net.BookieSocketAddress;
import org.apache.bookkeeper.proto.BookieServer;
import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
-import org.apache.bookkeeper.util.MathUtils;
+import org.apache.bookkeeper.test.annotations.FlakyTest;
import org.apache.zookeeper.KeeperException;
-import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -136,7 +135,7 @@ public class BookKeeperDiskSpaceWeightedLedgerPlacementTest
extends BookKeeperCl
/**
* Test to show that weight based selection honors the disk weight of
bookies
*/
- @Test(timeout=60000)
+ @FlakyTest("https://github.com/apache/bookkeeper/issues/503")
public void testDiskSpaceWeightedBookieSelection() throws Exception {
long freeDiskSpace=1000000L;
int multiple=3;
@@ -182,7 +181,7 @@ public class BookKeeperDiskSpaceWeightedLedgerPlacementTest
extends BookKeeperCl
* Test to show that weight based selection honors the disk weight of
bookies and also adapts
* when the bookies's weight changes.
*/
- @Test(timeout=60000)
+ @FlakyTest("https://github.com/apache/bookkeeper/issues/503")
public void testDiskSpaceWeightedBookieSelectionWithChangingWeights()
throws Exception {
long freeDiskSpace=1000000L;
int multiple=3;
@@ -264,7 +263,7 @@ public class BookKeeperDiskSpaceWeightedLedgerPlacementTest
extends BookKeeperCl
* Test to show that weight based selection honors the disk weight of
bookies and also adapts
* when bookies go away permanently.
*/
- @Test(timeout=60000)
+ @FlakyTest("https://github.com/apache/bookkeeper/issues/503")
public void testDiskSpaceWeightedBookieSelectionWithBookiesDying() throws
Exception {
long freeDiskSpace=1000000L;
int multiple=3;
@@ -339,7 +338,7 @@ public class BookKeeperDiskSpaceWeightedLedgerPlacementTest
extends BookKeeperCl
* Test to show that weight based selection honors the disk weight of
bookies and also adapts
* when bookies are added.
*/
- @Test(timeout=60000)
+ @FlakyTest("https://github.com/apache/bookkeeper/issues/503")
public void testDiskSpaceWeightedBookieSelectionWithBookiesBeingAdded()
throws Exception {
long freeDiskSpace=1000000L;
int multiple=3;
@@ -407,7 +406,7 @@ public class BookKeeperDiskSpaceWeightedLedgerPlacementTest
extends BookKeeperCl
* Tests that the bookie selection is based on the amount of free disk
space a bookie has. Also make sure that
* the periodic bookieInfo read is working and causes the new weights to
be taken into account.
*/
- @Test(timeout=60000)
+ @FlakyTest("https://github.com/apache/bookkeeper/issues/503")
public void
testDiskSpaceWeightedBookieSelectionWithPeriodicBookieInfoUpdate() throws
Exception {
long freeDiskSpace=1000000L;
int multiple=3;
diff --git
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java
index 7656b9b..80ba193 100644
---
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java
+++
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java
@@ -717,8 +717,6 @@ public class BookKeeperTest extends
BookKeeperClusterTestCase {
for (Enumeration<LedgerEntry> readEntries = lh.readEntries(0,
numEntries - 1);
readEntries.hasMoreElements();) {
LedgerEntry entry = readEntries.nextElement();
- assertTrue(entry.data.getClass().getName(),
-
entry.data.getClass().getName().contains("PooledNonRetainedSlicedByteBuf"));
try {
entry.data.release();
} catch (IllegalReferenceCountException ok) {
@@ -739,8 +737,6 @@ public class BookKeeperTest extends
BookKeeperClusterTestCase {
for (Enumeration<LedgerEntry> readEntries = lh.readEntries(0,
numEntries - 1);
readEntries.hasMoreElements();) {
LedgerEntry entry = readEntries.nextElement();
- assertTrue(entry.data.getClass().getName(),
-
entry.data.getClass().getName().contains("UnpooledSlicedByteBuf"));
try {
entry.data.release();
} catch (IllegalReferenceCountException e) {
@@ -761,8 +757,6 @@ public class BookKeeperTest extends
BookKeeperClusterTestCase {
for (Enumeration<LedgerEntry> readEntries = lh.readEntries(0,
numEntries - 1);
readEntries.hasMoreElements();) {
LedgerEntry entry = readEntries.nextElement();
- assertTrue(entry.data.getClass().getName(),
-
entry.data.getClass().getName().contains("UnpooledSlicedByteBuf"));
assertTrue("Can't release entry " + entry.getEntryId() +
": ref = " + entry.data.refCnt(),
entry.data.release());
try {
@@ -787,8 +781,6 @@ public class BookKeeperTest extends
BookKeeperClusterTestCase {
readEntries.hasMoreElements();) {
LedgerEntry entry = readEntries.nextElement();
// ButeBufs not reference counter
- assertTrue(entry.data.getClass().getName(),
-
entry.data.getClass().getName().contains("UnpooledSlicedByteBuf"));
assertTrue("Can't release entry " + entry.getEntryId() +
": ref = " + entry.data.refCnt(),
entry.data.release());
try {
diff --git
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/annotations/FlakyTest.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/annotations/FlakyTest.java
new file mode 100644
index 0000000..2890f35
--- /dev/null
+++
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/annotations/FlakyTest.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.bookkeeper.test.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Intended for marking a test case as flaky.
+ */
+@Documented
+@Retention(RetentionPolicy.SOURCE)
+public @interface FlakyTest {
+
+ /**
+ * Context information such as links to discussion thread, tracking issues
etc.
+ *
+ * @return context information about this flaky test.
+ */
+ String value();
+}
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].