Skip to content
  • Jean Boussier's avatar
    c650ef42
    Improve reliability of EventedFileUpdateCheckerTest fork test · c650ef42
    Jean Boussier authored
    `Listen.to` starts a bunch of background threads that need to perform
    some work before they are able to receive events, but it doesn't block
    until they are ready, which expose us to a race condition.
    
    With `wait_for_state(:processing_events)` we can ensure that it's ready on
    Linux, however on macOS, the Darwin backend has a second background thread
    we can't wait on.
    
    As a workaround we wait a bit after the fork to allow that thread to
    reach it's listning state.
    c650ef42
    Improve reliability of EventedFileUpdateCheckerTest fork test
    Jean Boussier authored
    `Listen.to` starts a bunch of background threads that need to perform
    some work before they are able to receive events, but it doesn't block
    until they are ready, which expose us to a race condition.
    
    With `wait_for_state(:processing_events)` we can ensure that it's ready on
    Linux, however on macOS, the Darwin backend has a second background thread
    we can't wait on.
    
    As a workaround we wait a bit after the fork to allow that thread to
    reach it's listning state.
Loading