Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/memcached test fails occasionally in Travis CI #224

Open
esabol opened this issue Dec 4, 2018 · 5 comments
Open

t/memcached test fails occasionally in Travis CI #224

esabol opened this issue Dec 4, 2018 · 5 comments

Comments

@esabol
Copy link
Member

esabol commented Dec 4, 2018

The t/memcached fails in Travis CI sometimes. I figured we needed an issue to track it.

When the failure happens, the following message appears in test-suite.log:

libtest/client.cc:269: in start() pid(30680) localhost:60040 ping(libtest/client.cc:269: Connection refused), additionally pid: 30745 is alive: true waited: 17 server started. exec: /home/travis/build/gearman/gearmand/libtool --mode=execute /home/travis/build/gearman/gearmand/./gearmand/gearmand --verbose=INFO --log-file=var/log/gearmand.loggBEQRs --pid-file=var/run/gearmand.pidkQkA2d --port=60040 --queue-type=libmemcached --libmemcached-servers=localhost:24735 --listen=localhost  stderr:
tests/memcached_test.cc:119: in lp_1054377_TEST() pid(30680) Assertion 'server_startup(servers, "gearmand", first_port, argv)'
memcached.queue restart.lp:1054377					[ failed ]

What causes it?

A race condition with libtest's get_free_port(), right? So the port becomes busy in between the call to get_free_port() and when the t/memcached uses it, presumably.

Possible solutions

  • Disable memcached in Travis CI? Effective, but not desirable since it reduces code coverage.
  • Modify the test to retry a few times?
  • Randomize the port number?
  • Other ideas?
@SpamapS
Copy link
Member

SpamapS commented Dec 5, 2018

Related/duplicate #50

@esabol
Copy link
Member Author

esabol commented Dec 5, 2018

Ah, right... I saw that, but I didn't get past the title since I was mainly concerned with t/memcached instead t/cycle. Lots of good discussion there already.

@esabol
Copy link
Member Author

esabol commented Dec 5, 2018

Ok, how about having memcached bind to port 0 and then using ss or lsof or netstat to get the port number memcached ends up listening on?

https://unix.stackexchange.com/questions/157823/list-ports-a-process-pid-is-listening-on-preferably-using-iproute2-tools

@esabol
Copy link
Member Author

esabol commented Dec 5, 2018

Actually, it appears the problem isn't with the memcached port, but in starting up gearmand:

ASSERT_TRUE(server_startup(servers, "gearmand", first_port, argv));

@p-alik
Copy link
Collaborator

p-alik commented Dec 11, 2018

Actually, it appears the problem isn't with the memcached port, but in starting up gearmand

Indeed, but in the line 119

ASSERT_TRUE(server_startup(servers, "gearmand", first_port, argv));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants