# HG changeset patch # User Yasumasa Suenaga # Date 1498463630 -32400 # Node ID bf321f1c93859fa7cf120f6278f3362431610443 # Parent 84f67233da38eac8f5125d65907d9ac26baa6bf6 Bug 3407: [TEST] jcmd should not be run for safepoint in ThreadExhausted tests Reviewed-by: ykubota https://github.com/HeapStats/heapstats/pull/104 diff -r 84f67233da38 -r bf321f1c9385 ChangeLog --- a/ChangeLog Thu Jun 22 09:55:19 2017 +0900 +++ b/ChangeLog Mon Jun 26 16:53:50 2017 +0900 @@ -1,3 +1,7 @@ +2017-06-26 Yasumasa Suenaga + + * Bug 3405: HeapStats Agent cannot be built on CentOS 6 after Bug 3403 + 2017-06-21 KUBOTA Yuji * Bug 3406: [TEST]Add race condition tests for core components diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -27,4 +27,4 @@ return (symbol.find("DynLoad") != -1) -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnResourceExhausted", common.return_true, True, False, True) +common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnResourceExhausted", common.return_true, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -21,4 +21,4 @@ import common -common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, True, True, True) +common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, True, True, True, False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -36,4 +36,4 @@ def Cond_ThreadExhausted(): return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_THREADS) != 0) -common.initialize("OnResourceExhausted", Cond_MemoryExhausted, "OnResourceExhausted", Cond_ThreadExhausted, True, False, True) +common.initialize("OnResourceExhausted", Cond_MemoryExhausted, "OnResourceExhausted", Cond_ThreadExhausted, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -21,4 +21,4 @@ import common -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnResourceExhausted", common.return_true, False, False, True) +common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnResourceExhausted", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -22,4 +22,4 @@ import common -common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, False, True) +common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -36,4 +36,4 @@ def Cond_ThreadExhausted(): return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_THREADS) != 0) -common.initialize("OnResourceExhausted", Cond_ThreadExhausted, "OnResourceExhausted", Cond_MemoryExhausted, True, False, True) +common.initialize("OnResourceExhausted", Cond_ThreadExhausted, "OnResourceExhausted", Cond_MemoryExhausted, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -27,4 +27,4 @@ return (symbol.find("DynLoad") != -1) -common.initialize("OnResourceExhausted", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True, False, True) +common.initialize("OnResourceExhausted", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -21,4 +21,4 @@ import common -common.initialize("OnResourceExhausted", common.return_true, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, False, True) +common.initialize("OnResourceExhausted", common.return_true, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/test.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/test.py Mon Jun 26 16:53:50 2017 +0900 @@ -21,4 +21,4 @@ import common -common.initialize("OnResourceExhausted", common.return_true, "OnResourceExhausted", common.return_true, False, False, True) +common.initialize("OnResourceExhausted", common.return_true, "OnResourceExhausted", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 84f67233da38 -r bf321f1c9385 agent/test/race-condition/common.py --- a/agent/test/race-condition/common.py Thu Jun 22 09:55:19 2017 +0900 +++ b/agent/test/race-condition/common.py Mon Jun 26 16:53:50 2017 +0900 @@ -57,13 +57,14 @@ class RaceConditionGenerator: - def __init__(self, primary, secondary, secondary_enabled, need_safepoint, is_reverse): + def __init__(self, primary, secondary, secondary_enabled, need_safepoint, is_reverse, jcmd_for_safepoint): self.__primary = primary self.__secondary = secondary self.__secondary_enabled = secondary_enabled self.__need_safepoint = need_safepoint self.__safepoint_breaker = None self.__is_reverse = is_reverse + self.__jcmd_for_safepoint = jcmd_for_safepoint def coordinate(self): if((not self.__secondary_enabled) and (not self.__primary.enabled) and (self.__secondary.thread_num == -1)): @@ -72,7 +73,8 @@ if self.__need_safepoint: if self.__safepoint_breaker is None: self.__safepoint_breaker = SafepointBreaker(self) - threading.Thread(target=os.system, args=("jcmd 0 GC.run",)).start() + if self.__jcmd_for_safepoint: + threading.Thread(target=os.system, args=("jcmd 0 GC.run",)).start() return elif not self.__safepoint_breaker.at_safepoint: return @@ -125,7 +127,7 @@ gdb.execute("quit") -def initialize(primary, primary_cond, secondary, secondary_cond, secondary_enabled, is_reverse=False, at_safepoint=False): +def initialize(primary, primary_cond, secondary, secondary_cond, secondary_enabled, is_reverse=False, at_safepoint=False, jcmd_for_safepoint=True): gdb.execute("set confirm off") gdb.execute("set breakpoint pending on") gdb.execute("set target-async on") @@ -135,7 +137,7 @@ p = BreakPointHandler(primary, primary_cond) s = BreakPointHandler(secondary, secondary_cond) s.enabled = secondary_enabled - rcgen = RaceConditionGenerator(p, s, secondary_enabled, at_safepoint, is_reverse) + rcgen = RaceConditionGenerator(p, s, secondary_enabled, at_safepoint, is_reverse, jcmd_for_safepoint) gdb.events.stop.connect(StopHandler(rcgen)) gdb.events.exited.connect(exit_handler)