nickva commented on issue #520: chore: more robust test
URL: https://github.com/apache/couchdb/pull/520#issuecomment-301368364
 
 
   It seems because this is testing for a continuous replication, if task 
status is not there, it is probably because it hasn't been posted(updated) yet.
   
   Since this is not a primary thing we test, ignoring a failed task status 
check is not terrible. Wonder if we could wait for it anyway. Something like 
this:
   
   ```
    
   +wait_for_task_status() ->
   +    test_util:wait(fun() ->
   +        case couch_task_status:all() of
   +            [] ->
   +                wait;
   +            Tasks ->
   +                Tasks
   +        end
   +    end).
   +
    
        Pid = ?l2b(pid_to_list(RepPid)),
        ok = wait_for_replicator(RepId),
   -    [RepTask] = couch_task_status:all(),
   +    RepTasks = wait_for_task_status(),
   +    ?assertNotEqual(timeout, RepTasks),
   +    [RepTask] = RepTasks,
   
   ```
 
----------------------------------------------------------------
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