Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
0797c4d3
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0797c4d3
编写于
6月 20, 2017
作者:
M
Matteo Merli
提交者:
GitHub
6月 20, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed tests timeouts for PartitionedProducerConsumerTest (#500)
上级
5b93f10d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
15 deletion
+23
-15
pulsar-broker/src/test/java/com/yahoo/pulsar/client/api/PartitionedProducerConsumerTest.java
...oo/pulsar/client/api/PartitionedProducerConsumerTest.java
+23
-15
未找到文件。
pulsar-broker/src/test/java/com/yahoo/pulsar/client/api/PartitionedProducerConsumerTest.java
浏览文件 @
0797c4d3
...
...
@@ -22,6 +22,7 @@ import static org.testng.Assert.fail;
import
java.util.Set
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -38,23 +39,30 @@ import com.yahoo.pulsar.client.api.ProducerConfiguration.MessageRoutingMode;
import
com.yahoo.pulsar.client.impl.PartitionedProducerImpl
;
import
com.yahoo.pulsar.common.naming.DestinationName
;
import
io.netty.util.concurrent.DefaultThreadFactory
;
public
class
PartitionedProducerConsumerTest
extends
ProducerConsumerBase
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
PartitionedProducerConsumerTest
.
class
);
private
ExecutorService
executor
;
@BeforeClass
@Override
protected
void
setup
()
throws
Exception
{
super
.
internalSetup
();
super
.
producerBaseSetup
();
executor
=
Executors
.
newFixedThreadPool
(
1
,
new
DefaultThreadFactory
(
"PartitionedProducerConsumerTest"
));
}
@AfterClass
@Override
protected
void
cleanup
()
throws
Exception
{
super
.
internalCleanup
();
executor
.
shutdown
();
}
@Test
@Test
(
timeOut
=
30000
)
public
void
testRoundRobinProducer
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
@@ -96,7 +104,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
log
.
info
(
"-- Exiting {} test --"
,
methodName
);
}
@Test
@Test
(
timeOut
=
30000
)
public
void
testPartitionedTopicNameWithSpecialCharacter
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
@@ -115,7 +123,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
log
.
info
(
"-- Exiting {} test --"
,
methodName
);
}
@Test
@Test
(
timeOut
=
30000
)
public
void
testSinglePartitionProducer
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
@@ -159,7 +167,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
log
.
info
(
"-- Exiting {} test --"
,
methodName
);
}
@Test
@Test
(
timeOut
=
30000
)
public
void
testKeyBasedProducer
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
@@ -216,7 +224,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
Assert
.
assertTrue
(
messageSet
.
add
(
message
),
"Received duplicate message "
+
message
);
}
@Test
@Test
(
timeOut
=
30000
)
public
void
testInvalidSequence
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
@@ -266,7 +274,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
}
@Test
@Test
(
timeOut
=
30000
)
public
void
testSillyUser
()
throws
Exception
{
int
numPartitions
=
4
;
...
...
@@ -328,7 +336,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
}
@Test
@Test
(
timeOut
=
30000
)
public
void
testDeletePartitionedTopic
()
throws
Exception
{
int
numPartitions
=
4
;
DestinationName
dn
=
DestinationName
.
get
(
"persistent://my-property/use/my-ns/my-partitionedtopic6"
);
...
...
@@ -348,7 +356,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
}
}
@Test
(
timeOut
=
4
000
)
@Test
(
timeOut
=
30
000
)
public
void
testAsyncPartitionedProducerConsumer
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
@@ -381,7 +389,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
// receive messages
CountDownLatch
latch
=
new
CountDownLatch
(
totalMsg
);
receiveAsync
(
consumer
,
totalMsg
,
0
,
latch
,
consumeMsgs
,
Executors
.
newFixedThreadPool
(
1
)
);
receiveAsync
(
consumer
,
totalMsg
,
0
,
latch
,
consumeMsgs
,
executor
);
latch
.
await
();
...
...
@@ -399,7 +407,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
log
.
info
(
"-- Exiting {} test --"
,
methodName
);
}
@Test
(
timeOut
=
4
000
)
@Test
(
timeOut
=
30
000
)
public
void
testAsyncPartitionedProducerConsumerQueueSizeOne
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
@@ -432,7 +440,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
// receive messages
CountDownLatch
latch
=
new
CountDownLatch
(
totalMsg
);
receiveAsync
(
consumer
,
totalMsg
,
0
,
latch
,
consumeMsgs
,
Executors
.
newFixedThreadPool
(
1
)
);
receiveAsync
(
consumer
,
totalMsg
,
0
,
latch
,
consumeMsgs
,
executor
);
latch
.
await
();
...
...
@@ -455,7 +463,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
*
* @throws Exception
*/
@Test
@Test
(
timeOut
=
30000
)
public
void
testFairDistributionForPartitionConsumers
()
throws
Exception
{
log
.
info
(
"-- Starting {} test --"
,
methodName
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录