You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Andor Molnar <an...@apache.org> on 2019/11/02 08:13:52 UTC

Re: Failing C API tests on Linux

Hi deepak,

It’s a single test failure originally, not a build error.
Removing TestClient.cc will cause all kinds of problems, because I believe most tests are dependent on it.

You can try to run the tests multiple times and if it still fails may try debugging it.

What system are you running the build on?

Andor




> On 2019. Oct 31., at 22:03, deepak <de...@gmail.com> wrote:
> 
> It turns out I had not built the ZooKeeper core before building the C API
> (it had a class not found exception in logs).  After building the ZooKeeper
> core, trying to build the C API still gives me failures (see below).  Could
> someone help me with this?  How should I go about figuring out what is
> wrong?
> 
> Zookeeper_simpleSystem::testAsyncWatcherAutoResetterminate called after
> throwing an instance of 'CppUnit::Exception'
>  what():  equality assertion failed
> - Expected: -101
> - Actual  : -4
> 
> /bin/sh: line 5:  7241 Aborted                 ZKROOT=./../..
> CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
> FAIL: zktest-mt
> ==========================================
> 1 of 2 tests failed
> Please report to user@zookeeper.apache.org
> ==========================================
> 
> If I uncomment just the testAsyncWatcherAutoReset in tests/TestClient.cc,
> then I get a whole bunch of other failures:
> 
> Zookeeper_simpleSystem::testDeserializeString : elapsed 0 : OK
> Zookeeper_simpleSystem::testFirstServerDown : assertion : elapsed 11002
> Zookeeper_simpleSystem::testNullData : assertion : elapsed 1001
> Zookeeper_simpleSystem::testIPV6 : assertion : elapsed 1000
> Zookeeper_simpleSystem::testCreate : assertion : elapsed 1000
> Zookeeper_simpleSystem::testCreateContainer : assertion : elapsed 1000
> Zookeeper_simpleSystem::testCreateTtl : assertion : elapsed 1000
> Zookeeper_simpleSystem::testPath : assertion : elapsed 1000
> Zookeeper_simpleSystem::testPathValidation : assertion : elapsed 1000
> Zookeeper_simpleSystem::testPing : assertion : elapsed 2001
> Zookeeper_simpleSystem::testAcl : assertion : elapsed 1000
> Zookeeper_simpleSystem::testChroot : assertion : elapsed 2001
> Zookeeper_simpleSystem::testAuth : assertion : elapsed 1000
> Zookeeper_simpleSystem::testHangingClient : elapsed 1001 : OK
> Zookeeper_simpleSystem::testWatcherAutoResetWithGlobal : assertion :
> elapsed 1000
> Zookeeper_simpleSystem::testWatcherAutoResetWithLocal : assertion : elapsed
> 1000
> Zookeeper_simpleSystem::testGetChildren2 : assertion : elapsed 1000
> Zookeeper_simpleSystem::testLastZxid : assertion : elapsed 2001
> Zookeeper_simpleSystem::testRemoveWatchers : assertion : elapsed 1000
> Zookeeper_readOnly::testReadOnly./tests/zkServer.sh: line 55: kill: (19172)
> - No such process
> this target is for unit tests only
> : assertion : elapsed 11
> tests/TestClientRetry.cc:137: Assertion: equality assertion failed
> [Expected: 1, Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected: 1,
> Actual  : 0]
> tests/TestClient.cc:327: Assertion: assertion failed [Expression:
> ctx.waitForConnected(zk)]
> tests/TestClient.cc:783: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:773: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:686: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:712: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:725: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:807: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:489: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:375: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:548: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:908: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:578: Assertion: equality assertion failed [Expected: 0,
> Actual  : -9]
> tests/TestClient.cc:1266: Assertion: equality assertion failed [Expected:
> 0, Actual  : -4]
> tests/TestClient.cc:1285: Assertion: equality assertion failed [Expected:
> 0, Actual  : -4]
> tests/TestClient.cc:739: Assertion: equality assertion failed [Expected: 0,
> Actual  : -4]
> tests/TestClient.cc:1314: Assertion: equality assertion failed [Expected:
> 0, Actual  : -4]
> tests/TestClient.cc:1373: Assertion: equality assertion failed [Expected:
> 0, Actual  : -4]
> tests/TestReadOnlyClient.cc:75: Assertion: assertion failed [Expression:
> system(cmd) == 0]
> Failures !!!
> Run: 76   Failure total: 32   Failures: 32   Errors: 0
> FAIL: zktest-mt
> ==========================================
> 1 of 2 tests failed
> Please report to user@zookeeper.apache.org
> ==========================================
> make[1]: *** [check-TESTS] Error 1
> make[1]: Leaving directory
> `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-client-c'
> make: *** [check-am] Error 2
> 
> 
> Thank you,
> Deepak
> 
> On Wed, Oct 30, 2019 at 4:40 PM deepak <de...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I am trying to build and run the C client API tests on Linux and I'm
>> getting the following error on both CentOS (7.5.1804) and Debian (stretch)
>> machines.
>> 
>> Could someone guide me in fixing this?
>> 
>> [...snip...]
>> Zookeeper_reconfig::testMigrationCycle : elapsed 0 : OK
>> TestReconfigServer::testNonIncremental/usr/bin/java
>> ZooKeeper JMX enabled by default
>> Using config: ./../../build/test/test-cppunit/conf/0.conf
>> Starting zookeeper ... FAILED TO START
>> zktest-mt: tests/ZooKeeperQuorumServer.cc:67: void
>> ZooKeeperQuorumServer::start(): Assertion `system(command.c_str()) == 0'
>> failed.
>> /bin/sh: line 5:  7539 Aborted                 ZKROOT=./../..
>> CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
>> FAIL: zktest-mt
>> ==========================================
>> 1 of 2 tests failed
>> Please report to user@zookeeper.apache.org
>> ==========================================
>> make[1]: *** [check-TESTS] Error 1
>> make[1]: Leaving directory
>> `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-client-c'
>> make: *** [check-am] Error 2
>> 


Re: Failing C API tests on Linux

Posted by Damien Diederen <dd...@crosstwine.com>.
Hi Andor, Deepak,


Deepak wrote:
>>> It turns out I had not built the ZooKeeper core before building the
>>> C API (it had a class not found exception in logs).  After building
>>> the
>
> As a side note, it seems the "make check" target expects base_dir to
> be set.  So I had to set it manually from the command line (just like
> how it's set in the maven project's "test" phase).

For the record, I currently run tests with Ant while "iterating" on the
C client.  A single:

    $ ant test-core-cppunit

allows one to go from a clean checkout of the repository to seeing test
results.  (It also performs incremental builds, but I would suggest
regularly starting from scratch, particularly when the dust starts to
settle.)


I have also seen errors with some Git revisions, due to port 3000
clashes when an ensemble starts while a singleton server is still
running.  I haven't had a chance to investigate, but am currently using
this as a workaround (all servers are correctly shut down once the test
finishes):

    --- a/zookeeper-client/zookeeper-client-c/tests/ZooKeeperQuorumServer.h
    +++ b/zookeeper-client/zookeeper-client-c/tests/ZooKeeperQuorumServer.h
    @@ -51,9 +51,9 @@ class ZooKeeperQuorumServer {
         static std::string getServerString(uint32_t id);
         std::string getMode();

    -    static const uint32_t SERVER_PORT_BASE = 2000;
    -    static const uint32_t ELECTION_PORT_BASE = 3000;
    -    static const uint32_t CLIENT_PORT_BASE = 4000;
    +    static const uint32_t SERVER_PORT_BASE = 4000;
    +    static const uint32_t ELECTION_PORT_BASE = 5000;
    +    static const uint32_t CLIENT_PORT_BASE = 6000;

         uint32_t numServers_;
         uint32_t id_;

(I will submit a PR if/when I figure out why other people don't seem to
be seeing this specific issue.)


Hope this helps, -D




Andor Molnar <an...@apache.org> writes:
> Thanks Deepak!
>
> I'm not familiar with our Makefile, but to my best knowledge
> build/tests/etc. should all run with Maven to work properly.
>
> Andor
>
>
>
> -----Original Message-----
> From: deepak <de...@gmail.com>
> Reply-To: user@zookeeper.apache.org
> To: user@zookeeper.apache.org
> Subject: Re: Failing C API tests on Linux
> Date: Tue, 5 Nov 2019 18:42:30 -0600
>
> Hi Andor,
>
> Thank you for the suggestion.  It turns out I had stale zkdata
> directory
> under /tmp that was causing permission denied errors from within tests.
> Once I removed those, the tests passed.
> As a side note, it seems the "make check" target expects base_dir to be
> set.  So I had to set it manually from the command line (just like how
> it's
> set in the maven project's "test" phase).
>
> --
> Deepak
>
> On Sat, Nov 2, 2019 at 3:13 AM Andor Molnar <an...@apache.org> wrote:
>
>> Hi deepak,
>> 
>> It’s a single test failure originally, not a build error.
>> Removing TestClient.cc will cause all kinds of problems, because I
>> believe
>> most tests are dependent on it.
>> 
>> You can try to run the tests multiple times and if it still fails may
>> try
>> debugging it.
>> 
>> What system are you running the build on?
>> 
>> Andor
>> 
>> 
>> 
>> 
>> > On 2019. Oct 31., at 22:03, deepak <de...@gmail.com> wrote:
>> > 
>> > It turns out I had not built the ZooKeeper core before building the
>> > C API
>> > (it had a class not found exception in logs).  After building the
>> ZooKeeper
>> > core, trying to build the C API still gives me failures (see
>> > below).
>> Could
>> > someone help me with this?  How should I go about figuring out what
>> > is
>> > wrong?
>> > 
>> > Zookeeper_simpleSystem::testAsyncWatcherAutoResetterminate called
>> > after
>> > throwing an instance of 'CppUnit::Exception'
>> >  what():  equality assertion failed
>> > - Expected: -101
>> > - Actual  : -4
>> > 
>> > /bin/sh: line 5:  7241 Aborted                 ZKROOT=./../..
>> > CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
>> > FAIL: zktest-mt
>> > ==========================================
>> > 1 of 2 tests failed
>> > Please report to user@zookeeper.apache.org
>> > ==========================================
>> > 
>> > If I uncomment just the testAsyncWatcherAutoReset in
>> > tests/TestClient.cc,
>> > then I get a whole bunch of other failures:
>> > 
>> > Zookeeper_simpleSystem::testDeserializeString : elapsed 0 : OK
>> > Zookeeper_simpleSystem::testFirstServerDown : assertion : elapsed
>> > 11002
>> > Zookeeper_simpleSystem::testNullData : assertion : elapsed 1001
>> > Zookeeper_simpleSystem::testIPV6 : assertion : elapsed 1000
>> > Zookeeper_simpleSystem::testCreate : assertion : elapsed 1000
>> > Zookeeper_simpleSystem::testCreateContainer : assertion : elapsed
>> > 1000
>> > Zookeeper_simpleSystem::testCreateTtl : assertion : elapsed 1000
>> > Zookeeper_simpleSystem::testPath : assertion : elapsed 1000
>> > Zookeeper_simpleSystem::testPathValidation : assertion : elapsed
>> > 1000
>> > Zookeeper_simpleSystem::testPing : assertion : elapsed 2001
>> > Zookeeper_simpleSystem::testAcl : assertion : elapsed 1000
>> > Zookeeper_simpleSystem::testChroot : assertion : elapsed 2001
>> > Zookeeper_simpleSystem::testAuth : assertion : elapsed 1000
>> > Zookeeper_simpleSystem::testHangingClient : elapsed 1001 : OK
>> > Zookeeper_simpleSystem::testWatcherAutoResetWithGlobal : assertion
>> > :
>> > elapsed 1000
>> > Zookeeper_simpleSystem::testWatcherAutoResetWithLocal : assertion :
>> elapsed
>> > 1000
>> > Zookeeper_simpleSystem::testGetChildren2 : assertion : elapsed 1000
>> > Zookeeper_simpleSystem::testLastZxid : assertion : elapsed 2001
>> > Zookeeper_simpleSystem::testRemoveWatchers : assertion : elapsed
>> > 1000
>> > Zookeeper_readOnly::testReadOnly./tests/zkServer.sh: line 55: kill:
>> (19172)
>> > - No such process
>> > this target is for unit tests only
>> > : assertion : elapsed 11
>> > tests/TestClientRetry.cc:137: Assertion: equality assertion failed
>> > [Expected: 1, Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestMulti.cc:213: Assertion: equality assertion failed
>> > [Expected:
>> 1,
>> > Actual  : 0]
>> > tests/TestClient.cc:327: Assertion: assertion failed [Expression:
>> > ctx.waitForConnected(zk)]
>> > tests/TestClient.cc:783: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:773: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:686: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:712: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:725: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:807: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:489: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:375: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:548: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:908: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:578: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -9]
>> > tests/TestClient.cc:1266: Assertion: equality assertion failed
>> > [Expected:
>> > 0, Actual  : -4]
>> > tests/TestClient.cc:1285: Assertion: equality assertion failed
>> > [Expected:
>> > 0, Actual  : -4]
>> > tests/TestClient.cc:739: Assertion: equality assertion failed
>> > [Expected:
>> 0,
>> > Actual  : -4]
>> > tests/TestClient.cc:1314: Assertion: equality assertion failed
>> > [Expected:
>> > 0, Actual  : -4]
>> > tests/TestClient.cc:1373: Assertion: equality assertion failed
>> > [Expected:
>> > 0, Actual  : -4]
>> > tests/TestReadOnlyClient.cc:75: Assertion: assertion failed
>> > [Expression:
>> > system(cmd) == 0]
>> > Failures !!!
>> > Run: 76   Failure total: 32   Failures: 32   Errors: 0
>> > FAIL: zktest-mt
>> > ==========================================
>> > 1 of 2 tests failed
>> > Please report to user@zookeeper.apache.org
>> > ==========================================
>> > make[1]: *** [check-TESTS] Error 1
>> > make[1]: Leaving directory
>> > `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-
>> > client-c'
>> > make: *** [check-am] Error 2
>> > 
>> > 
>> > Thank you,
>> > Deepak
>> > 
>> > On Wed, Oct 30, 2019 at 4:40 PM deepak <de...@gmail.com> wrote:
>> > 
>> > > Hi,
>> > > 
>> > > I am trying to build and run the C client API tests on Linux and
>> > > I'm
>> > > getting the following error on both CentOS (7.5.1804) and Debian
>> (stretch)
>> > > machines.
>> > > 
>> > > Could someone guide me in fixing this?
>> > > 
>> > > [...snip...]
>> > > Zookeeper_reconfig::testMigrationCycle : elapsed 0 : OK
>> > > TestReconfigServer::testNonIncremental/usr/bin/java
>> > > ZooKeeper JMX enabled by default
>> > > Using config: ./../../build/test/test-cppunit/conf/0.conf
>> > > Starting zookeeper ... FAILED TO START
>> > > zktest-mt: tests/ZooKeeperQuorumServer.cc:67: void
>> > > ZooKeeperQuorumServer::start(): Assertion
>> > > `system(command.c_str()) == 0'
>> > > failed.
>> > > /bin/sh: line 5:  7539 Aborted                 ZKROOT=./../..
>> > > CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
>> > > FAIL: zktest-mt
>> > > ==========================================
>> > > 1 of 2 tests failed
>> > > Please report to user@zookeeper.apache.org
>> > > ==========================================
>> > > make[1]: *** [check-TESTS] Error 1
>> > > make[1]: Leaving directory
>> > > 
>> `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-
>> client-c'
>> > > make: *** [check-am] Error 2

-- 
http://crosstwine.com
tel:  +49 89 2302 9288
cell: +49 174 3489 428

“Strong Opinions, Weakly Held”
		— Bob Johansen

Re: Failing C API tests on Linux

Posted by Andor Molnar <an...@apache.org>.
Thanks Deepak!

I'm not familiar with our Makefile, but to my best knowledge
build/tests/etc. should all run with Maven to work properly.

Andor



-----Original Message-----
From: deepak <de...@gmail.com>
Reply-To: user@zookeeper.apache.org
To: user@zookeeper.apache.org
Subject: Re: Failing C API tests on Linux
Date: Tue, 5 Nov 2019 18:42:30 -0600

Hi Andor,

Thank you for the suggestion.  It turns out I had stale zkdata
directory
under /tmp that was causing permission denied errors from within tests.
Once I removed those, the tests passed.
As a side note, it seems the "make check" target expects base_dir to be
set.  So I had to set it manually from the command line (just like how
it's
set in the maven project's "test" phase).

--
Deepak

On Sat, Nov 2, 2019 at 3:13 AM Andor Molnar <an...@apache.org> wrote:

> Hi deepak,
> 
> It’s a single test failure originally, not a build error.
> Removing TestClient.cc will cause all kinds of problems, because I
> believe
> most tests are dependent on it.
> 
> You can try to run the tests multiple times and if it still fails may
> try
> debugging it.
> 
> What system are you running the build on?
> 
> Andor
> 
> 
> 
> 
> > On 2019. Oct 31., at 22:03, deepak <de...@gmail.com> wrote:
> > 
> > It turns out I had not built the ZooKeeper core before building the
> > C API
> > (it had a class not found exception in logs).  After building the
> ZooKeeper
> > core, trying to build the C API still gives me failures (see
> > below).
> Could
> > someone help me with this?  How should I go about figuring out what
> > is
> > wrong?
> > 
> > Zookeeper_simpleSystem::testAsyncWatcherAutoResetterminate called
> > after
> > throwing an instance of 'CppUnit::Exception'
> >  what():  equality assertion failed
> > - Expected: -101
> > - Actual  : -4
> > 
> > /bin/sh: line 5:  7241 Aborted                 ZKROOT=./../..
> > CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
> > FAIL: zktest-mt
> > ==========================================
> > 1 of 2 tests failed
> > Please report to user@zookeeper.apache.org
> > ==========================================
> > 
> > If I uncomment just the testAsyncWatcherAutoReset in
> > tests/TestClient.cc,
> > then I get a whole bunch of other failures:
> > 
> > Zookeeper_simpleSystem::testDeserializeString : elapsed 0 : OK
> > Zookeeper_simpleSystem::testFirstServerDown : assertion : elapsed
> > 11002
> > Zookeeper_simpleSystem::testNullData : assertion : elapsed 1001
> > Zookeeper_simpleSystem::testIPV6 : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testCreate : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testCreateContainer : assertion : elapsed
> > 1000
> > Zookeeper_simpleSystem::testCreateTtl : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testPath : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testPathValidation : assertion : elapsed
> > 1000
> > Zookeeper_simpleSystem::testPing : assertion : elapsed 2001
> > Zookeeper_simpleSystem::testAcl : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testChroot : assertion : elapsed 2001
> > Zookeeper_simpleSystem::testAuth : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testHangingClient : elapsed 1001 : OK
> > Zookeeper_simpleSystem::testWatcherAutoResetWithGlobal : assertion
> > :
> > elapsed 1000
> > Zookeeper_simpleSystem::testWatcherAutoResetWithLocal : assertion :
> elapsed
> > 1000
> > Zookeeper_simpleSystem::testGetChildren2 : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testLastZxid : assertion : elapsed 2001
> > Zookeeper_simpleSystem::testRemoveWatchers : assertion : elapsed
> > 1000
> > Zookeeper_readOnly::testReadOnly./tests/zkServer.sh: line 55: kill:
> (19172)
> > - No such process
> > this target is for unit tests only
> > : assertion : elapsed 11
> > tests/TestClientRetry.cc:137: Assertion: equality assertion failed
> > [Expected: 1, Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed
> > [Expected:
> 1,
> > Actual  : 0]
> > tests/TestClient.cc:327: Assertion: assertion failed [Expression:
> > ctx.waitForConnected(zk)]
> > tests/TestClient.cc:783: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:773: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:686: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:712: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:725: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:807: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:489: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:375: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:548: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:908: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:578: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -9]
> > tests/TestClient.cc:1266: Assertion: equality assertion failed
> > [Expected:
> > 0, Actual  : -4]
> > tests/TestClient.cc:1285: Assertion: equality assertion failed
> > [Expected:
> > 0, Actual  : -4]
> > tests/TestClient.cc:739: Assertion: equality assertion failed
> > [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:1314: Assertion: equality assertion failed
> > [Expected:
> > 0, Actual  : -4]
> > tests/TestClient.cc:1373: Assertion: equality assertion failed
> > [Expected:
> > 0, Actual  : -4]
> > tests/TestReadOnlyClient.cc:75: Assertion: assertion failed
> > [Expression:
> > system(cmd) == 0]
> > Failures !!!
> > Run: 76   Failure total: 32   Failures: 32   Errors: 0
> > FAIL: zktest-mt
> > ==========================================
> > 1 of 2 tests failed
> > Please report to user@zookeeper.apache.org
> > ==========================================
> > make[1]: *** [check-TESTS] Error 1
> > make[1]: Leaving directory
> > `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-
> > client-c'
> > make: *** [check-am] Error 2
> > 
> > 
> > Thank you,
> > Deepak
> > 
> > On Wed, Oct 30, 2019 at 4:40 PM deepak <de...@gmail.com> wrote:
> > 
> > > Hi,
> > > 
> > > I am trying to build and run the C client API tests on Linux and
> > > I'm
> > > getting the following error on both CentOS (7.5.1804) and Debian
> (stretch)
> > > machines.
> > > 
> > > Could someone guide me in fixing this?
> > > 
> > > [...snip...]
> > > Zookeeper_reconfig::testMigrationCycle : elapsed 0 : OK
> > > TestReconfigServer::testNonIncremental/usr/bin/java
> > > ZooKeeper JMX enabled by default
> > > Using config: ./../../build/test/test-cppunit/conf/0.conf
> > > Starting zookeeper ... FAILED TO START
> > > zktest-mt: tests/ZooKeeperQuorumServer.cc:67: void
> > > ZooKeeperQuorumServer::start(): Assertion
> > > `system(command.c_str()) == 0'
> > > failed.
> > > /bin/sh: line 5:  7539 Aborted                 ZKROOT=./../..
> > > CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
> > > FAIL: zktest-mt
> > > ==========================================
> > > 1 of 2 tests failed
> > > Please report to user@zookeeper.apache.org
> > > ==========================================
> > > make[1]: *** [check-TESTS] Error 1
> > > make[1]: Leaving directory
> > > 
> `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-
> client-c'
> > > make: *** [check-am] Error 2
> > > 


Re: Failing C API tests on Linux

Posted by deepak <de...@gmail.com>.
Hi Andor,

Thank you for the suggestion.  It turns out I had stale zkdata directory
under /tmp that was causing permission denied errors from within tests.
Once I removed those, the tests passed.
As a side note, it seems the "make check" target expects base_dir to be
set.  So I had to set it manually from the command line (just like how it's
set in the maven project's "test" phase).

--
Deepak

On Sat, Nov 2, 2019 at 3:13 AM Andor Molnar <an...@apache.org> wrote:

> Hi deepak,
>
> It’s a single test failure originally, not a build error.
> Removing TestClient.cc will cause all kinds of problems, because I believe
> most tests are dependent on it.
>
> You can try to run the tests multiple times and if it still fails may try
> debugging it.
>
> What system are you running the build on?
>
> Andor
>
>
>
>
> > On 2019. Oct 31., at 22:03, deepak <de...@gmail.com> wrote:
> >
> > It turns out I had not built the ZooKeeper core before building the C API
> > (it had a class not found exception in logs).  After building the
> ZooKeeper
> > core, trying to build the C API still gives me failures (see below).
> Could
> > someone help me with this?  How should I go about figuring out what is
> > wrong?
> >
> > Zookeeper_simpleSystem::testAsyncWatcherAutoResetterminate called after
> > throwing an instance of 'CppUnit::Exception'
> >  what():  equality assertion failed
> > - Expected: -101
> > - Actual  : -4
> >
> > /bin/sh: line 5:  7241 Aborted                 ZKROOT=./../..
> > CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
> > FAIL: zktest-mt
> > ==========================================
> > 1 of 2 tests failed
> > Please report to user@zookeeper.apache.org
> > ==========================================
> >
> > If I uncomment just the testAsyncWatcherAutoReset in tests/TestClient.cc,
> > then I get a whole bunch of other failures:
> >
> > Zookeeper_simpleSystem::testDeserializeString : elapsed 0 : OK
> > Zookeeper_simpleSystem::testFirstServerDown : assertion : elapsed 11002
> > Zookeeper_simpleSystem::testNullData : assertion : elapsed 1001
> > Zookeeper_simpleSystem::testIPV6 : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testCreate : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testCreateContainer : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testCreateTtl : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testPath : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testPathValidation : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testPing : assertion : elapsed 2001
> > Zookeeper_simpleSystem::testAcl : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testChroot : assertion : elapsed 2001
> > Zookeeper_simpleSystem::testAuth : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testHangingClient : elapsed 1001 : OK
> > Zookeeper_simpleSystem::testWatcherAutoResetWithGlobal : assertion :
> > elapsed 1000
> > Zookeeper_simpleSystem::testWatcherAutoResetWithLocal : assertion :
> elapsed
> > 1000
> > Zookeeper_simpleSystem::testGetChildren2 : assertion : elapsed 1000
> > Zookeeper_simpleSystem::testLastZxid : assertion : elapsed 2001
> > Zookeeper_simpleSystem::testRemoveWatchers : assertion : elapsed 1000
> > Zookeeper_readOnly::testReadOnly./tests/zkServer.sh: line 55: kill:
> (19172)
> > - No such process
> > this target is for unit tests only
> > : assertion : elapsed 11
> > tests/TestClientRetry.cc:137: Assertion: equality assertion failed
> > [Expected: 1, Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestMulti.cc:213: Assertion: equality assertion failed [Expected:
> 1,
> > Actual  : 0]
> > tests/TestClient.cc:327: Assertion: assertion failed [Expression:
> > ctx.waitForConnected(zk)]
> > tests/TestClient.cc:783: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:773: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:686: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:712: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:725: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:807: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:489: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:375: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:548: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:908: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:578: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -9]
> > tests/TestClient.cc:1266: Assertion: equality assertion failed [Expected:
> > 0, Actual  : -4]
> > tests/TestClient.cc:1285: Assertion: equality assertion failed [Expected:
> > 0, Actual  : -4]
> > tests/TestClient.cc:739: Assertion: equality assertion failed [Expected:
> 0,
> > Actual  : -4]
> > tests/TestClient.cc:1314: Assertion: equality assertion failed [Expected:
> > 0, Actual  : -4]
> > tests/TestClient.cc:1373: Assertion: equality assertion failed [Expected:
> > 0, Actual  : -4]
> > tests/TestReadOnlyClient.cc:75: Assertion: assertion failed [Expression:
> > system(cmd) == 0]
> > Failures !!!
> > Run: 76   Failure total: 32   Failures: 32   Errors: 0
> > FAIL: zktest-mt
> > ==========================================
> > 1 of 2 tests failed
> > Please report to user@zookeeper.apache.org
> > ==========================================
> > make[1]: *** [check-TESTS] Error 1
> > make[1]: Leaving directory
> > `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-client-c'
> > make: *** [check-am] Error 2
> >
> >
> > Thank you,
> > Deepak
> >
> > On Wed, Oct 30, 2019 at 4:40 PM deepak <de...@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> I am trying to build and run the C client API tests on Linux and I'm
> >> getting the following error on both CentOS (7.5.1804) and Debian
> (stretch)
> >> machines.
> >>
> >> Could someone guide me in fixing this?
> >>
> >> [...snip...]
> >> Zookeeper_reconfig::testMigrationCycle : elapsed 0 : OK
> >> TestReconfigServer::testNonIncremental/usr/bin/java
> >> ZooKeeper JMX enabled by default
> >> Using config: ./../../build/test/test-cppunit/conf/0.conf
> >> Starting zookeeper ... FAILED TO START
> >> zktest-mt: tests/ZooKeeperQuorumServer.cc:67: void
> >> ZooKeeperQuorumServer::start(): Assertion `system(command.c_str()) == 0'
> >> failed.
> >> /bin/sh: line 5:  7539 Aborted                 ZKROOT=./../..
> >> CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar ${dir}$tst
> >> FAIL: zktest-mt
> >> ==========================================
> >> 1 of 2 tests failed
> >> Please report to user@zookeeper.apache.org
> >> ==========================================
> >> make[1]: *** [check-TESTS] Error 1
> >> make[1]: Leaving directory
> >>
> `/home/centos/apache-zookeeper-3.5.6/zookeeper-client/zookeeper-client-c'
> >> make: *** [check-am] Error 2
> >>
>
>