basho-labs / riak-c-client

Riak C Client
Apache License 2.0
20 stars 8 forks source link

Couple 'o CUnit Integration Tests #56

Closed hazen closed 10 years ago

hazen commented 10 years ago
bookshelfdave commented 10 years ago

a couple of compile warnings on make check:

test/cunit/test.c:153:47: warning: format specifies type 'unsigned int' but the argument has type 'riak_uint64_t' (aka 'unsigned long long')
      [-Wformat]
        fprintf(stderr, "Spawned TID %ull\n", (riak_uint64_t)(state[i].tid));
                                     ~~       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     %llu
test/cunit/test.c:303:80: warning: format specifies type 'unsigned int' but the argument has type 'riak_uint64_t' (aka 'unsigned long long')
      [-Wformat]
    fprintf(stderr, "Event Loop on TID %ull with base %x and connection %x\n", (riak_uint64_t)pthread_self(), conn->base, conn);
                                       ~~                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                       %llu
test/cunit/test.c:303:111: warning: format specifies type 'unsigned int' but the argument has type 'struct event_base *' [-Wformat]
    fprintf(stderr, "Event Loop on TID %ull with base %x and connection %x\n", (riak_uint64_t)pthread_self(), conn->base, conn);
                                                      ~~                                                      ^~~~~~~~~~
test/cunit/test.c:303:123: warning: format specifies type 'unsigned int' but the argument has type 'test_async_connection *'
      (aka 'struct _test_async_connection *') [-Wformat]
    fprintf(stderr, "Event Loop on TID %ull with base %x and connection %x\n", (riak_uint64_t)pthread_self(), conn->base, conn);
                                                                        ~~                                                ^~~~
test/cunit/test.c:309:49: warning: format specifies type 'unsigned int' but the argument has type 'riak_uint64_t' (aka 'unsigned long long')
      [-Wformat]
    fprintf(stderr, "Event Send on TID %ull\n", (riak_uint64_t)pthread_self());
                                       ~~       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                       %llu
test/cunit/test.c:313:65: warning: format specifies type 'unsigned int' but the argument has type 'riak_uint64_t' (aka 'unsigned long long')
      [-Wformat]
        fprintf(stderr, "Event Loop on TID %ull returned %d\n", (riak_uint64_t)pthread_self(), result);
                                           ~~                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           %llu
hazen commented 10 years ago

Those are all debug messages for multi-theading. I debated keeping them in. I guess I could #ifdef them out and only use them for debug builds.

bookshelfdave commented 10 years ago

segfault:

R16B02b4:[feature/bch/cunit-integration-tests]prime:~/basho/riak-c-client$ export RIAK_TEST_PB_PORT=10017
R16B02b4:[feature/bch/cunit-integration-tests]prime:~/basho/riak-c-client$ make check
/usr/bin/make  riak_c_cunit
make[1]: `riak_c_cunit' is up to date.
/usr/bin/make  check-TESTS
./test-driver: line 107: 96718 Segmentation fault: 11  "$@" > $log_file 2>&1
FAIL: riak_c_cunit
make[3]: Nothing to be done for `all'.
============================================================================
Testsuite summary for riak_c_client 0.5
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================
make[2]: *** [test-suite.log] Error 1
make[1]: *** [check-TESTS] Error 2
make: *** [check-am] Error 2
bookshelfdave commented 10 years ago

Seg fault reproducible if you have security enabled in Riak: riak-admin security enable

bookshelfdave commented 10 years ago

tests pass without security enabled, which is outside the scope of this PR:

============================================================================
Testsuite summary for riak_c_client 0.5
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
bookshelfdave commented 10 years ago

ok, the latest changes look good:

============================================================================
Testsuite summary for riak_c_client 0.5
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

+1, let's roll