eiri commented on issue #590: Wait for listener's exit during restart test
URL: https://github.com/apache/couchdb/pull/590#issuecomment-309078019
 
 
   So I've been pondering on this for a while and I don't see a good solution 
on how we can fix this race without altering the test.
   
   The issue here is that when we are trying to confirm that handler got 
removed from `config_event` manager we are aiming in a pretty narrow gap 
between `config_listener`'s terminate and `couch_log_sup` spawning and 
registering new `config_listener_mon`.
   
   We can ensure that we are not checking handlers before old listener dies, 
but we can't delay supervisor without mocking `couch_log_sup` to set delay in 
its `handle_config_terminate`.
   And mocking the very module we are testing doesn't seems right to me.
   
   So I removed assertion on that short moment when handler is not in 
`config_event` and used it as a flag to wait on new listener to start. Then 
I've added assertion on that it is indeed a new listener and it is registered 
as the same handler id, which should be enough to confirm that listener's 
restart is working as expected.
   
   @davisp I believe you are the original author of this test. Do you think 
this change is acceptable and doesn't compromise integrity of the test?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to