Fix timing error oom-score-adj test (#8513)

fixes timing issue, fork didn't always get to set the oom score before the test verified it.
This commit is contained in:
sundb 2021-02-19 19:01:25 +08:00 committed by GitHub
parent 303465af35
commit 46346e9e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,12 @@ if {$system_name eq {linux}} {
r bgsave
set child_pid [get_child_pid 0]
assert_equal [get_oom_score_adj $child_pid] [expr $base + 30]
# Wait until background child process to setOOMScoreAdj success.
wait_for_condition 100 10 {
[get_oom_score_adj $child_pid] == [expr $base + 30]
} else {
fail "Set oom-score-adj of background child process is not ok"
}
}
# Failed oom-score-adj tests can only run unprivileged