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

eunit couch_log_config_test failed with get_listener() found #581

Closed
wohali opened this issue Jun 6, 2017 · 1 comment
Closed

eunit couch_log_config_test failed with get_listener() found #581

wohali opened this issue Jun 6, 2017 · 1 comment

Comments

@wohali
Copy link
Member

wohali commented Jun 6, 2017

Current & Expected Behaviour

Sometimes, the couch_log_config_listener_test test couch_log_config_test_ fails. It should always pass

Makefile output:

module 'couch_log_config_listener_test'
  couch_log_config_listener_test: couch_log_config_test_...*failed*
in function couch_log_config_listener_test:'-check_restart_listener/0-fun-2-'/1 (test/couch_log_config_listener_test.erl, line 38)
in call from couch_log_config_listener_test:check_restart_listener/0 (test/couch_log_config_listener_test.erl, line 38)
**error:{assertEqual_failed,[{module,couch_log_config_listener_test},
                     {line,38},
                     {expression,"get_handler ( )"},
                     {expected,not_found},
                     {value,{config_listener,{couch_log_sup,<0.3334.0>}}}]}

  couch_log_config_listener_test: couch_log_config_test_...[1.002 s] ok
  [done in 1.008 s]

couch.log from the uploader is EMPTY.

Possible Solution

Looks like this test is expecting gen_event:delete_handler to occur immediately. Should there be a timer:sleep() call prior to checking get_handler()?

Context

This used to be known as https://issues.apache.org/jira/browse/COUCHDB-3341 but is now on GH Issues.

@eiri
Copy link
Member

eiri commented Jun 8, 2017

Just a note: it turned out there could be two causes for this failure 1) we are indeed checking event manager before it had chance to remove old handler 2) couch_log_sup is super fast and spawns and register new handler before we are pulling which_handlers/1, so we are getting new handler. Just sleep would help in half of the cases, so I ended with something a bit more verbose. Hope it'll work more reliably.

@eiri eiri closed this as completed in #590 Jun 16, 2017
@wohali wohali modified the milestone: 2.1.0 Jul 4, 2017
nickva added a commit to nickva/couchdb that referenced this issue Sep 7, 2022
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

2 participants