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 NP logging config reload on SIGHUP #57681

Merged
merged 7 commits into from
Feb 20, 2020

Conversation

mshustov
Copy link
Contributor

@mshustov mshustov commented Feb 14, 2020

Summary

Refactored tests for LP getting rid of mutability, it should slightly improve readability.
Added similar tests for the NP logging config.

For maintainers

@mshustov mshustov added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Feb 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@mshustov mshustov added chore v7.7.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Feb 17, 2020
@mshustov mshustov marked this pull request as ready for review February 17, 2020 10:16
@mshustov mshustov requested a review from a team February 17, 2020 12:33
@mshustov
Copy link
Contributor Author

@elasticmachine merge upstream

@mshustov mshustov changed the title Reload NP logging config on SIGHUP Test NP logging config reload on SIGHUP Feb 18, 2020
@joshdover
Copy link
Contributor

The old test was not skipped before, so it must have been passing, however we know the feature is/was broken. Do we know why it was passing? A quick scan of the old test looks like it may not have been reopening the file handle?

@mshustov
Copy link
Contributor Author

Do we know why it was passing?

I think so. "Broken" means that Kibana writes in both new and old log files simultaneously. The current test is a smoke test verifying the logging system manages a new destination after SIGHUP.

Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could DRY this up a bit, but probably not worth it since we'll just remove the legacy one in 8.0.


if (matcher.test(contents)) {
clearTimeout(timeoutHandle);
Fs.unwatchFile(path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could move this to a finally on the outer promise

);

it(
'should recreate file handler on SIGHUP',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
'should recreate file handler on SIGHUP',
'should recreate file handle on SIGHUP',

30 * second
);
it(
'should recreate file handler on SIGHUP',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
'should recreate file handler on SIGHUP',
'should recreate file handle on SIGHUP',

@mshustov mshustov force-pushed the reload-np-logging-config branch from 0f2c0bf to 4d7cbb1 Compare February 20, 2020 08:00
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mshustov mshustov merged commit dd8eb62 into elastic:master Feb 20, 2020
@mshustov mshustov deleted the reload-np-logging-config branch February 20, 2020 11:05
mshustov added a commit to mshustov/kibana that referenced this pull request Feb 20, 2020
* TSify reload config test and simplify logic

* get rid of mutable config in tests

* increase timeouts

* address comments
mshustov added a commit that referenced this pull request Feb 20, 2020
* TSify reload config test and simplify logic

* get rid of mutable config in tests

* increase timeouts

* address comments
@spalger
Copy link
Contributor

spalger commented Feb 26, 2020

I have noticed a few timeouts in the jest integration tests in the last couple days, trying to track down what's causing them in #58543 but I suspect this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported chore Feature:New Platform release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants