Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

tests: fix race in test-http-curl-chunk-problem #9301

Commits on Feb 28, 2015

  1. tests: fix race in test-http-curl-chunk-problem

    This test setups two event listeners: one on a child process' exit event
    , another for the same child process' stdandard output's 'data' event.
    The data even listener writes to a stream, and the exit event listener
    ends it.
    
    Because the exit event can be emitted before the data event, there is a
    chance that something will be written to the stream after it's ended,
    and that an error is thrown.
    
    This change makes the test end the stream in the listener for the child
    process' standard output's end event, which is guaranteed to be emitted
    after the last data event, thus avoiding the race.
    Julien Gilli committed Feb 28, 2015
    Configuration menu
    Copy the full SHA
    3499c97 View commit details
    Browse the repository at this point in the history