Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ab1591ed
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ab1591ed
编写于
7月 06, 2016
作者:
P
poonam
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8071487: javax/management/monitor/GaugeMonitorDeadlockTest.java timed out
Reviewed-by: dholmes
上级
eca3b715
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
5 deletion
+8
-5
test/javax/management/monitor/GaugeMonitorDeadlockTest.java
test/javax/management/monitor/GaugeMonitorDeadlockTest.java
+6
-3
test/javax/management/monitor/StringMonitorDeadlockTest.java
test/javax/management/monitor/StringMonitorDeadlockTest.java
+2
-2
未找到文件。
test/javax/management/monitor/GaugeMonitorDeadlockTest.java
浏览文件 @
ab1591ed
...
...
@@ -27,6 +27,7 @@
* @summary Test that no locks are held when a monitor attribute is sampled
* or notif delivered.
* @author Eamonn McManus
* @library /lib/testlibrary
* @run clean GaugeMonitorDeadlockTest
* @run build GaugeMonitorDeadlockTest
* @run main GaugeMonitorDeadlockTest 1
...
...
@@ -47,6 +48,8 @@ import javax.management.ObjectName;
import
javax.management.monitor.GaugeMonitor
;
import
javax.management.monitor.GaugeMonitorMBean
;
import
jdk.testlibrary.Utils
;
public
class
GaugeMonitorDeadlockTest
{
private
static
enum
When
{
IN_GET_ATTRIBUTE
,
IN_NOTIFY
};
private
static
long
checkingTime
;
...
...
@@ -54,8 +57,7 @@ public class GaugeMonitorDeadlockTest {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(
args
.
length
!=
1
)
throw
new
Exception
(
"Arg should be test number"
);
double
factor
=
Double
.
parseDouble
(
System
.
getProperty
(
"test.timeout.factor"
,
"1.0"
));
checkingTime
=
(
long
)
factor
*
1000
;
checkingTime
=
Utils
.
adjustTimeout
(
1000
);
// default 1s timeout
System
.
out
.
println
(
"=== checkingTime = "
+
checkingTime
+
"ms"
);
int
testNo
=
Integer
.
parseInt
(
args
[
0
])
-
1
;
...
...
@@ -101,11 +103,12 @@ public class GaugeMonitorDeadlockTest {
monitorProxy
.
setGranularityPeriod
(
10L
);
// 10 ms
monitorProxy
.
setNotifyHigh
(
true
);
monitorProxy
.
setNotifyLow
(
true
);
monitorProxy
.
start
();
System
.
out
.
println
(
"=== Waiting observedProxy.getGetCount() to be "
+
"changed, presumable deadlock if timeout?"
);
final
int
initGetCount
=
observedProxy
.
getGetCount
();
monitorProxy
.
start
();
long
checkedTime
=
System
.
currentTimeMillis
();
long
nowTime
;
ThreadMXBean
threadMXBean
=
ManagementFactory
.
getThreadMXBean
();
...
...
test/javax/management/monitor/StringMonitorDeadlockTest.java
浏览文件 @
ab1591ed
...
...
@@ -37,7 +37,6 @@
import
java.lang.management.ManagementFactory
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
javax.management.Attribute
;
import
javax.management.JMX
;
import
javax.management.MBeanServer
;
import
javax.management.Notification
;
...
...
@@ -95,9 +94,10 @@ public class StringMonitorDeadlockTest {
monitorProxy
.
setStringToCompare
(
"old"
);
monitorProxy
.
setGranularityPeriod
(
10L
);
// 10 ms
monitorProxy
.
setNotifyDiffer
(
true
);
monitorProxy
.
start
();
final
int
initGetCount
=
observedProxy
.
getGetCount
();
monitorProxy
.
start
();
int
getCount
=
initGetCount
;
for
(
int
i
=
0
;
i
<
500
;
i
++)
{
// 500 * 10 = 5 seconds
getCount
=
observedProxy
.
getGetCount
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录