Skip to content
  • Simon Marlow's avatar
    Fix an assertion that could randomly fail · ce13a9a9
    Simon Marlow authored
    Summary:
    ASSERT_THREADED_CAPABILITY_INVARIANTS was testing properties of the
    returning_tasks queue, but that requires cap->lock to access safely.
    This assertion would randomly fail if stressed enough.
    
    Instead I've removed it from the catch-all
    ASSERT_PARTIAL_CAPABILITIY_INVARIANTS and made it a separate assertion
    only called under cap->lock.
    
    Test Plan:
    ```
    cd testsuite/tests/concurrent/should_run
    make TEST=setnumcapabilities001 WAY=threaded1 EXTRA_HC_OPTS=-with-rtsopts=-DS CLEANUP=0
    while true; do ./setnumcapabilities001.run/setnumcapabilities001 4 9 2000 || break; done
    ```
    
    Reviewers: niteria, bgamari, ezyang, austin, erikd
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2440
    
    GHC Trac Issues: #10860
    ce13a9a9