ctdb-tests: Log errors if the test fails
authorAmitay Isaacs <amitay@gmail.com>
Mon, 1 Aug 2016 04:23:23 +0000 (14:23 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 10 Aug 2016 06:17:13 +0000 (08:17 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Aug 10 08:17:13 CEST 2016 on sn-devel-144

ctdb/tests/src/transaction_loop.c

index 3b325fd384d31bedd432ad16fba8ba1795cc9707..0fd2953d1a11edb14d8bc8ffb0cea8e10e319f60 100644 (file)
@@ -162,6 +162,7 @@ static void transaction_loop_started(struct tevent_req *subreq)
        ret = ctdb_transaction_fetch_record(state->h, state->key,
                                            state, &data);
        if (ret != 0) {
        ret = ctdb_transaction_fetch_record(state->h, state->key,
                                            state, &data);
        if (ret != 0) {
+               fprintf(stderr, "transaction fetch record failed\n");
                tevent_req_error(req, ret);
                return;
        }
                tevent_req_error(req, ret);
                return;
        }
@@ -246,6 +247,7 @@ static void transaction_loop_each_second(struct tevent_req *subreq)
        status = tevent_wakeup_recv(subreq);
        TALLOC_FREE(subreq);
        if (! status) {
        status = tevent_wakeup_recv(subreq);
        TALLOC_FREE(subreq);
        if (! status) {
+               fprintf(stderr, "tevent wakeup failed\n");
                tevent_req_error(req, EIO);
                return;
        }
                tevent_req_error(req, EIO);
                return;
        }
@@ -390,7 +392,7 @@ int main(int argc, const char *argv[])
 
        status = transaction_loop_recv(req, &ret);
        if (! status) {
 
        status = transaction_loop_recv(req, &ret);
        if (! status) {
-               fprintf(stderr, "transaction loop test failed\n");
+               fprintf(stderr, "transaction loop test failed, ret=%d\n", ret);
                exit(1);
        }
 
                exit(1);
        }