test(coverage): cover deadlock detector + DB_REGISTER (lock_deadlock.c 0.7%→66%, env_register.c 0%→55%) - #74
Closed
gburd wants to merge 1 commit into
Closed
test(coverage): cover deadlock detector + DB_REGISTER (lock_deadlock.c 0.7%→66%, env_register.c 0%→55%)#74gburd wants to merge 1 commit into
gburd wants to merge 1 commit into
Conversation
…_coverage.sh
Add a COV_DEAD_REG block (on by default) that runs the two multi-process
suites reaching the deadlock detector and the process-registry crash/
recovery path, which the single-tclsh COV_TESTS loop cannot:
- dead001..dead006 spawn ddscript.tcl workers via wrap.tcl to build a
ring/clump lock cycle; __lock_detect (src/lock/lock_deadlock.c) then
picks a victim. dead002/003 run detection in-process in each worker.
- env007 + env012 use envscript.tcl to open the env with DB_REGISTER,
"crash" a process, and let a survivor detect the dead slot
(__envreg_register/__envreg_isalive, src/env/env_register.c) and run
recovery/failchk.
Like the COV_REP block these run driver-per-test with a per-test timeout
and orphan-worker cleanup (they reset TESTDIR and a hung worker must not
wedge the run). Proc counts are trimmed to {2 4} ({4} for dead005) so
each finishes well inside the 300s timeout; the full {2 4 10} matrix adds
only minutes, no new lines.
Measured on r-class box (gcc --coverage, lcov from .libs):
lock/lock_deadlock.c 0.7% -> 65.9% line (43.2% branch)
env/env_register.c 0.0% -> 54.7% line (43.1% branch)
env/env_failchk.c 17.4% -> 65.2% line (bonus, DB_REGISTER failchk path)
All eight tests pass reliably under timeout. README documents the block
and updates the least-covered table.
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wire the two multi-process suites that reach the previously-cold deadlock
detector and process-registry crash/recovery paths into
run_coverage.sh.What
New
COV_DEAD_REGblock (on by default), modeled on the existingCOV_REPblock (driver-per-test, per-test timeout, orphan-worker cleanup — these tests
reset
TESTDIRand each spawns childtclshviawrap.tcl, so a hung workermust not wedge the whole run):
dead001..dead006spawnddscript.tclworkers viawrap.tclto build a ring/clump lock cycle;__lock_detect(
src/lock/lock_deadlock.c) picks a victim.dead002/dead003set-lock_detectso detection runs in-process in each worker (which flushesits own
.gcda);dead001/004/005use the standalonedb_deadlock.env007+env012useenvscript.tclto open the env withDB_REGISTER, "crash" a process (kill without close), then reopen with-recover/-failchkso a survivor detects the dead slot(
__envreg_register/__envreg_isalive,src/env/env_register.c) and runsrecovery.
No new test files — these tests already existed; they just were never in the
coverage run. Proc counts are trimmed to
{2 4}({4}fordead005) so eachfinishes well inside the 300s timeout; the full
{2 4 10}matrix adds onlyminutes, no new lines.
Measured coverage (gcc --coverage, lcov from
.libs)lock/lock_deadlock.cenv/env_register.cenv/env_failchk.cTests run vs hang
All eight pass reliably under
timeout(300s each), workers cleaned up betweenruns:
At the full untrimmed
{2 4 10}matrixdead003/005/006exceed 300s (slow,not deadlocked — the 10-proc iterations just take minutes and add no new lines),
which is why the wired proc counts are trimmed. No real bug found: the detector
resolves every cycle and picks the expected victim; DB_REGISTER correctly
detects the crashed slot and recovers.
README updated (new env var row, a descriptive block, and the least-covered
table refreshed for the three files that moved off the floor).