Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
6051f5cb
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6051f5cb
编写于
2月 21, 2019
作者:
K
Kostas Kloudas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[hotfix] Fixing test instabilities in streaming.runtime.tasks.
上级
971c5633
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
3 deletion
+36
-3
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/OneInputStreamTaskTest.java
...flink/streaming/runtime/tasks/OneInputStreamTaskTest.java
+11
-0
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/SourceExternalCheckpointTriggerTest.java
...ng/runtime/tasks/SourceExternalCheckpointTriggerTest.java
+9
-2
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTaskTest.java
...e/flink/streaming/runtime/tasks/SourceStreamTaskTest.java
+5
-0
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/TwoInputStreamTaskTest.java
...flink/streaming/runtime/tasks/TwoInputStreamTaskTest.java
+11
-1
未找到文件。
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/OneInputStreamTaskTest.java
浏览文件 @
6051f5cb
...
...
@@ -123,6 +123,8 @@ public class OneInputStreamTaskTest extends TestLogger {
expectedOutput
.
add
(
new
StreamRecord
<
String
>(
"Hello"
,
initialTime
+
1
));
expectedOutput
.
add
(
new
StreamRecord
<
String
>(
"Ciao"
,
initialTime
+
2
));
testHarness
.
waitForInputProcessing
();
testHarness
.
endInput
();
testHarness
.
waitForTaskCompletion
();
...
...
@@ -564,6 +566,7 @@ public class OneInputStreamTaskTest extends TestLogger {
assertEquals
(
numberChainedTasks
,
TestingStreamOperator
.
numberRestoreCalls
);
TestingStreamOperator
.
numberRestoreCalls
=
0
;
TestingStreamOperator
.
numberSnapshotCalls
=
0
;
}
@Test
...
...
@@ -654,6 +657,9 @@ public class OneInputStreamTaskTest extends TestLogger {
assertEquals
(
numRecords
,
numRecordsInCounter
.
getCount
());
assertEquals
(
numRecords
*
2
*
2
*
2
,
numRecordsOutCounter
.
getCount
());
testHarness
.
endInput
();
testHarness
.
waitForTaskCompletion
();
}
static
class
DuplicatingOperator
extends
AbstractStreamOperator
<
String
>
implements
OneInputStreamOperator
<
String
,
String
>
{
...
...
@@ -889,6 +895,11 @@ public class OneInputStreamTaskTest extends TestLogger {
public
static
boolean
openCalled
=
false
;
public
static
boolean
closeCalled
=
false
;
TestOpenCloseMapFunction
()
{
openCalled
=
false
;
closeCalled
=
false
;
}
@Override
public
void
open
(
Configuration
parameters
)
throws
Exception
{
super
.
open
(
parameters
);
...
...
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/SourceExternalCheckpointTriggerTest.java
浏览文件 @
6051f5cb
...
...
@@ -32,6 +32,7 @@ import org.apache.flink.streaming.api.graph.StreamConfig;
import
org.apache.flink.streaming.api.operators.StreamSource
;
import
org.apache.flink.streaming.runtime.streamrecord.StreamRecord
;
import
org.junit.Before
;
import
org.junit.Test
;
import
java.util.concurrent.BlockingQueue
;
...
...
@@ -46,8 +47,14 @@ import static org.junit.Assert.assertTrue;
@SuppressWarnings
(
"serial"
)
public
class
SourceExternalCheckpointTriggerTest
{
private
static
final
OneShotLatch
ready
=
new
OneShotLatch
();
private
static
final
MultiShotLatch
sync
=
new
MultiShotLatch
();
private
static
OneShotLatch
ready
=
new
OneShotLatch
();
private
static
MultiShotLatch
sync
=
new
MultiShotLatch
();
@Before
public
void
resetLatches
()
{
ready
=
new
OneShotLatch
();
sync
=
new
MultiShotLatch
();
}
@Test
@SuppressWarnings
(
"unchecked"
)
...
...
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTaskTest.java
浏览文件 @
6051f5cb
...
...
@@ -255,6 +255,11 @@ public class SourceStreamTaskTest {
public
static
boolean
openCalled
=
false
;
public
static
boolean
closeCalled
=
false
;
OpenCloseTestSource
()
{
openCalled
=
false
;
closeCalled
=
false
;
}
@Override
public
void
open
(
Configuration
parameters
)
throws
Exception
{
super
.
open
(
parameters
);
...
...
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/TwoInputStreamTaskTest.java
浏览文件 @
6051f5cb
...
...
@@ -103,11 +103,13 @@ public class TwoInputStreamTaskTest {
expectedOutput
.
add
(
new
StreamRecord
<
String
>(
"1337"
,
initialTime
+
2
));
testHarness
.
waitForInputProcessing
();
testHarness
.
endInput
();
testHarness
.
waitForTaskCompletion
();
Assert
.
assertTrue
(
"RichFunction methods w
h
ere not called."
,
TestOpenCloseMapFunction
.
closeCalled
);
Assert
.
assertTrue
(
"RichFunction methods were not called."
,
TestOpenCloseMapFunction
.
closeCalled
);
TestHarnessUtil
.
assertOutputEquals
(
"Output was not correct."
,
expectedOutput
,
testHarness
.
getOutput
());
}
...
...
@@ -435,6 +437,9 @@ public class TwoInputStreamTaskTest {
assertEquals
(
numRecords1
+
numRecords2
,
numRecordsInCounter
.
getCount
());
assertEquals
((
numRecords1
+
numRecords2
)
*
2
*
2
*
2
,
numRecordsOutCounter
.
getCount
());
testHarness
.
endInput
();
testHarness
.
waitForTaskCompletion
();
}
static
class
DuplicatingOperator
extends
AbstractStreamOperator
<
String
>
implements
TwoInputStreamOperator
<
String
,
String
,
String
>
{
...
...
@@ -562,6 +567,11 @@ public class TwoInputStreamTaskTest {
public
static
boolean
openCalled
=
false
;
public
static
boolean
closeCalled
=
false
;
TestOpenCloseMapFunction
()
{
openCalled
=
false
;
closeCalled
=
false
;
}
@Override
public
void
open
(
Configuration
parameters
)
throws
Exception
{
super
.
open
(
parameters
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录