Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
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;
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;
Expand Down Expand Up @@ -103,7 +103,7 @@ public void testTriggerAudit() throws Exception {
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
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;

Expand Down Expand Up @@ -136,7 +135,7 @@ private BookieServer replaceBookieWithCustomFreeDiskSpaceBookie(
/**
* 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;
Expand Down Expand Up @@ -182,7 +181,7 @@ public void testDiskSpaceWeightedBookieSelection() throws Exception {
* 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;
Expand Down Expand Up @@ -264,7 +263,7 @@ public void testDiskSpaceWeightedBookieSelectionWithChangingWeights() throws Exc
* 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;
Expand Down Expand Up @@ -339,7 +338,7 @@ public void testDiskSpaceWeightedBookieSelectionWithBookiesDying() throws Except
* 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;
Expand Down Expand Up @@ -407,7 +406,7 @@ public void testDiskSpaceWeightedBookieSelectionWithBookiesBeingAdded() throws E
* 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,6 @@ public void testReadEntryReleaseByteBufs() throws Exception {
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) {
Expand All @@ -739,8 +737,6 @@ public void testReadEntryReleaseByteBufs() throws Exception {
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) {
Expand All @@ -761,8 +757,6 @@ public void testReadEntryReleaseByteBufs() throws Exception {
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 {
Expand All @@ -787,8 +781,6 @@ public void testReadEntryReleaseByteBufs() throws Exception {
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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}