sapling/tests/test-hgsql-pushrebase.t
Thomas Jacob 0e6b93a0e0 Add support for RocksDB
Summary:
- Add support for RocksDB engine (developed as a drop in replacement for innodb) to hgsql to allow new xdb.hgsql.1-10 shards to host hg repos
- Prefer MySQL test DBs in same region
- Run all hgsql unit tests also for RocksDB engine
- Allow for nested ifs to make that possible (downside if you switch off rockdb tests, innodb tests are run twice)

Reviewed By: quark-zju

Differential Revision: D7014064

fbshipit-source-id: 073c36176aa7eaf74252ef33c3f47da594920b28
2018-04-13 21:51:13 -07:00

69 lines
1.8 KiB
Perl

#testcases case-innodb case-rocksdb
#if case-rocksdb
$ DBENGINE=rocksdb
#else
$ DBENGINE=innodb
#endif
$ . "$TESTDIR/hgsql/library.sh"
$ cat >> $HGRCPATH <<EOF
> [extensions]
> pushrebase=
> [experimental]
> bundle2lazylocking=True
> EOF
Test verify sql lock is not held during prelockrebase and txnclose hooks
$ cat >> $TESTTMP/locktester.py <<EOF
> import os
> from mercurial import extensions, bundle2, util
> def checklock(repo, *args, **kwargs):
> if len(repo.heldlocks) > 0:
> raise util.Abort("lock was TAKEN")
> raise util.Abort("lock was FREE")
> EOF
$ initserver master master
$ cat >> master/.hg/hgrc <<EOF
> [hooks]
> prepushrebase=python:$TESTTMP/locktester.py:checklock
> txnclose=python:$TESTTMP/locktester.py:checklock
> EOF
$ cd master
$ touch a && hg ci -Aqm a
error: txnclose hook failed: lock was FREE
(run with --traceback for stack trace)
error: txnclose hook failed: lock was FREE
(run with --traceback for stack trace)
error: txnclose hook failed: lock was FREE
(run with --traceback for stack trace)
error: txnclose hook failed: lock was FREE
(run with --traceback for stack trace)
error: txnclose hook failed: lock was FREE
(run with --traceback for stack trace)
$ hg book master
error: txnclose hook failed: lock was FREE
(run with --traceback for stack trace)
$ cd ..
$ initclient client
$ cd client
$ hg pull -q ssh://user@dummy/master
$ hg up -q master
$ touch b && hg ci -Aqm b
$ hg push ssh://user@dummy/master --to master
pushing to ssh://user@dummy/master
searching for changes
remote: error: prepushrebase hook failed: lock was FREE
remote: lock was FREE
abort: push failed on remote
[255]
$ cd ../master
$ hg log -T '{rev}\n'
0