[starvation][strict mode] disable strict mode violation reporting and analysis by default

Summary:
Turn off by default until mature enough.
Also rename the dev-strict-mode test dir to highlight the dev part.

Reviewed By: mbouaziz

Differential Revision: D9775571

fbshipit-source-id: c3a41bbdf
master
Nikos Gorogiannis 6 years ago committed by Facebook Github Bot
parent 96e698a458
commit a6e5ab7fdb

@ -93,7 +93,7 @@ BUILD_SYSTEMS_TESTS += \
DIRECT_TESTS += \
java_checkers java_eradicate java_infer java_lab java_tracing java_quandary \
java_racerd java_stability java_crashcontext java_hoisting java_starvation java_performance \
java_strictmode
java_devstrictmode
ifneq ($(ANT),no)
BUILD_SYSTEMS_TESTS += ant
endif

@ -2129,6 +2129,11 @@ and profiler_samples =
$(b,--test-determinator)."
and starvation_strict_mode =
CLOpt.mk_bool ~long:"starvation-strict-mode" ~default:false
"During starvation analysis, report strict mode violations (Android only)"
and testing_mode =
CLOpt.mk_bool
~deprecated:["testing_mode"; "-testing_mode"; "tm"]
@ -2933,6 +2938,8 @@ and stacktraces_dir = !stacktraces_dir
and starvation = !starvation
and starvation_strict_mode = !starvation_strict_mode
and stats_report = !stats_report
and subtype_multirange = !subtype_multirange

@ -622,6 +622,8 @@ val stacktraces_dir : string option
val starvation : bool
val starvation_strict_mode : bool
val stats_report : string option
val subtype_multirange : bool

@ -214,20 +214,23 @@ let strict_mode_matchers =
(StrictModeModels.is_strict_mode_violation, High) :: strict_mode_common_matchers
(* at most one function is allowed to be true, sort from High to Low *)
let may_block =
let standard_matchers =
let open StarvationDomain.Event in
[ (is_accountManager_setUserData, High)
; (is_two_way_binder_transact, High)
; (is_countdownlatch_await, High)
; (is_thread_sleep, High)
; (is_object_wait, High)
; (is_asyncTask_get, Low)
; (is_future_get, Low) ]
(* sort from High to Low *)
let may_block =
let matchers =
if Config.dev_android_strict_mode then strict_mode_seed_matchers
else
strict_mode_matchers
@ [ (is_accountManager_setUserData, High)
; (is_two_way_binder_transact, High)
; (is_countdownlatch_await, High)
; (is_thread_sleep, High)
; (is_object_wait, High)
; (is_asyncTask_get, Low)
; (is_future_get, Low) ]
else if Config.starvation_strict_mode then strict_mode_matchers @ standard_matchers
else standard_matchers
in
fun tenv pn actuals ->
List.find_map matchers ~f:(fun (matcher, sev) -> Option.some_if (matcher tenv pn actuals) sev)

@ -0,0 +1,4 @@
codetoanalyze/java/devstrictmode/java/GuardTest.java, java.GuardTest.intraprocBad():void, 29, STARVATION, no_bucket, ERROR, [`void GuardTest.intraprocBad()`,Method call: `void GuardTest.privateOk()`,Method call: `void GuardTest.testReadBad()`,calls `void BlockGuard$Policy.onReadFromDisk()` from `void GuardTest.testReadBad()`]
codetoanalyze/java/devstrictmode/java/GuardTest.java, java.GuardTest.testNetBad():void, 21, STARVATION, no_bucket, ERROR, [`void GuardTest.testNetBad()`,calls `void BlockGuard$Policy.onNetwork()` from `void GuardTest.testNetBad()`]
codetoanalyze/java/devstrictmode/java/GuardTest.java, java.GuardTest.testReadBad():void, 17, STARVATION, no_bucket, ERROR, [`void GuardTest.testReadBad()`,calls `void BlockGuard$Policy.onReadFromDisk()` from `void GuardTest.testReadBad()`]
codetoanalyze/java/devstrictmode/java/GuardTest.java, java.GuardTest.testWriteBad():void, 13, STARVATION, no_bucket, ERROR, [`void GuardTest.testWriteBad()`,calls `void BlockGuard$Policy.onWriteToDisk()` from `void GuardTest.testWriteBad()`]

@ -1,4 +0,0 @@
codetoanalyze/java/strictmode/java/GuardTest.java, java.GuardTest.intraprocBad():void, 29, STARVATION, no_bucket, ERROR, [`void GuardTest.intraprocBad()`,Method call: `void GuardTest.privateOk()`,Method call: `void GuardTest.testReadBad()`,calls `void BlockGuard$Policy.onReadFromDisk()` from `void GuardTest.testReadBad()`]
codetoanalyze/java/strictmode/java/GuardTest.java, java.GuardTest.testNetBad():void, 21, STARVATION, no_bucket, ERROR, [`void GuardTest.testNetBad()`,calls `void BlockGuard$Policy.onNetwork()` from `void GuardTest.testNetBad()`]
codetoanalyze/java/strictmode/java/GuardTest.java, java.GuardTest.testReadBad():void, 17, STARVATION, no_bucket, ERROR, [`void GuardTest.testReadBad()`,calls `void BlockGuard$Policy.onReadFromDisk()` from `void GuardTest.testReadBad()`]
codetoanalyze/java/strictmode/java/GuardTest.java, java.GuardTest.testWriteBad():void, 13, STARVATION, no_bucket, ERROR, [`void GuardTest.testWriteBad()`,calls `void BlockGuard$Policy.onWriteToDisk()` from `void GuardTest.testWriteBad()`]
Loading…
Cancel
Save