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

JSDOM returns an error if there is almost no rules to run #203

Closed
sarvaje opened this issue May 12, 2017 · 1 comment
Closed

JSDOM returns an error if there is almost no rules to run #203

sarvaje opened this issue May 12, 2017 · 1 comment

Comments

@sarvaje
Copy link
Contributor

sarvaje commented May 12, 2017

If we deactivate all or almost all the rules and the option for the collector 'waitFor' is low, then we receive an error running sonar.

Steps to reproduce:

  1. use this configuration
    {
        "collector": {
            "name": "jsdom",
            "options": {
                "waitFor": 100
            }
        },
        "formatter": "stylish",
        "rules": {
            "axe": "off",
            "disallowed-headers": "off",
            "disown-opener": "off",
            "manifest-exists": "off",
            "manifest-file-extension": "off",
            "manifest-is-valid": "off",
            "no-friendly-error-pages": "off",
            "no-html-only-headers": "off",
            "no-protocol-relative-urls": "off",
            "ssllabs": "off",
            "x-content-type-options": "warning"
        }
    }
    
  2. run sonar npm run site -- https://developer.microsoft.com/en-us/microsoft-edge/

Expected:
Sonar report some warnings with x-content-type-options and returns with status code 0

Actual
Sonar report some errors with x-content-type-options and throw an expection:
image

@molant
Copy link
Member

molant commented May 12, 2017

From what I see this seems to happen because there are pending requests, we are calling .close() and the request manager crashes.
Because we are ending everything I think it should be enough with having a try/catch in the .close() method. At this point of the execution we don't care what happens to the collector next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants