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

[7.x] Ensure process exits if a process warning is emitted (#59651) #59980

Merged
merged 1 commit into from
Mar 12, 2020

Commits on Mar 12, 2020

  1. Ensure process exits if a process warning is emitted (elastic#59651)

    Crash Kibana in dev/CI if a process warning is detected. This does not
    influence how Kibana behaves in production when run via `./bin/kibana`
    as there the `--no-warnings` flag is used. We will detect this flag and
    as a result, disable this behavior.
    
    Previously we used the flags `--trace-warnings --throw-deprecation` when
    you started Kibana via `yarn start` and we used `--throw-deprecation` in
    CI. This meant that we would only crash on deprecation warnings and log
    a stack trace for all other types of warnings.
    
    There were a couple of drawbacks to this approach:
    
    1. If the deprecated API was called in a place enclosed in a try-catch
       (or inside of a Promise or an async/await context), the throw would
       be caught and the program would not crash.
    
    2. If you ran `./scripts/kibana` directly instead of running `yarn
       start`, you would not get these flags automatically.
    
    3. If you ran any of our tests locally you would not get the standard CI
       flags. This meant something that might seem to pass locally would not
       pass in CI.
    
    This commit changes this behavior by ensuring:
    
    - That we always crash - no matter if the offending code is surrounded
      by a try-catch (etc).
    
    - That you always get the same behavior whether you run `yarn start` or
      `./scripts/kibana`.
    
    - That you always get the same behavior in CI or if you run individual
      tests locally.
    
    Furthermore, we now crash for all types of warnings - not only
    deprecation warnings (except `MaxListenersExceededWarning`).
    
    Closes elastic#59646
    watson committed Mar 12, 2020
    Configuration menu
    Copy the full SHA
    c2078ea View commit details
    Browse the repository at this point in the history