Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve test-cluster-disconnect-suicide-race #4739

Closed
wants to merge 2 commits into from

Commits on Jan 18, 2016

  1. test: improve test-cluster-disconnect-suicide-race

    Previously, test-cluster-disconnect-suicide-race had two issues:
    
    * Magic numbers: How many times to spawn a worker was determined through
    empirical experimentation. This means that as new platforms and new
    CPU/RAM configurations are tested, the magic numbers require more
    and more refinement. This brings us to...
    
    * Non-determinism: The test seems to fail all the time when the bug
    it tests for is present, but it's really a judgment based on sampling.
    "Oh, with 8 workers per CPU, it fails about 80% of the time. Let's try
    16..."
    
    This revised version of the test takes a different approach. The fix
    for the bug that the test was written for means that the disconnect
    event will fire on a subsequent tick. So we check for that and the test
    still fails when the fix is not in the code base and succeeds when it
    is.
    
    Advantages of this approach include:
    
    * The test runs much faster.
    * The test should be reliable on any new platform regardless of CPU and
    RAM.
    
    Ref: nodejs#4674
    
    cc @santigimeno @iwuzhere
    Trott committed Jan 18, 2016
    Configuration menu
    Copy the full SHA
    7446fa4 View commit details
    Browse the repository at this point in the history
  2. fixup: improve assert

    Trott committed Jan 18, 2016
    Configuration menu
    Copy the full SHA
    898a226 View commit details
    Browse the repository at this point in the history