aboutsummaryrefslogtreecommitdiffstats
path: root/tests/db-exclusive-lock/t
blob: 7cbe550bd260d29a9603e117fce095ae856a6a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
interimap_init

# start a background process
interimap --watch=60 &
trap "ptree_abort $!" EXIT INT TERM

# wait a short while so we have time to lock the database (ugly and racy...)
sleep .5

# subsequent runs fail as we can't acquire the exclusive lock
! interimap || error

grep -Ex "DBD::SQLite::db do failed: database is locked at (\S+/)?interimap line 177\." <"$STDERR" \
    || error "Is \$DBH->do(\"PRAGMA locking_mode = EXCLUSIVE\"); at line 177?"

# vim: set filetype=sh :