tests/block-job-txn: Don't start block job before adding to txn
commitd90fce944647f8b2759f016b0f86bf36dffe34c8
authorFam Zheng <famz@redhat.com>
Fri, 7 Apr 2017 00:55:13 +0000 (7 08:55 +0800)
committerFam Zheng <famz@redhat.com>
Tue, 11 Apr 2017 12:07:15 +0000 (11 20:07 +0800)
tree4e4fcebe0f121b03eef522cf31236b16e0e204ca
parentaabf591007a83dc6520329bce929570115849286
tests/block-job-txn: Don't start block job before adding to txn

Previously, before test_block_job_start returns, the job can already
complete, as a result, the transactional state of other jobs added to
the same txn later cannot be handled correctly.

Move the block_job_start() calls to callers after
block_job_txn_add_job() calls.

Signed-off-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
tests/test-blockjob-txn.c