tdb: rewrite external agent for testing.
authorRusty Russell <rusty@rustcorp.com.au>
Sat, 11 Sep 2010 02:17:37 +0000 (11:47 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Sat, 11 Sep 2010 02:17:37 +0000 (11:47 +0930)
commita153d09b979182e8586d4501ea687bcdd466dabc
treeb82ae22a0e20daf02ae15432361f9c93b152b290
parent426c8dc977d0fb46286042f7072d86bc053836a1
tdb: rewrite external agent for testing.

For locking and transaction tests, we need an external process to probe the
tdb.  This code was a mess, and unreliable (occasional failures).  Rewrite
it so that instead of blocking and using SIGALRM, we mug fcntl and force
non-blocking locks.  We use a special return to day "I couldn't because
the lock wasn't available".

I also made the operations clearer and more orthogonal rather than "what
we needed for each test" which was really hard to understand.

It turns out those occasional failures weren't spurious.  Next patch!
ccan/tdb/test/external-agent.c [new file with mode: 0644]
ccan/tdb/test/external-agent.h [new file with mode: 0644]
ccan/tdb/test/external-transaction.c [deleted file]
ccan/tdb/test/external-transaction.h [deleted file]
ccan/tdb/test/lock-tracking.c
ccan/tdb/test/lock-tracking.h
ccan/tdb/test/run-die-during-transaction.c
ccan/tdb/test/run-nested-traverse.c
ccan/tdb/test/run-open-during-transaction.c
ccan/tdb/test/run-traverse-in-transaction.c