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

remove config.set() call to avoid race #8123

Merged
merged 1 commit into from
Aug 30, 2016

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Aug 30, 2016

Tests have been failing recently with "Error: Unexpected request: POST /api/kibana/settings/shortDots:enable, No more request expected" which seems to be caused by the field chooser tests calling config.set('shortDots:enable', origValue) in the test cleanup task. Rather than investigate it further I avoided the need to call config.set() by stubbing the config.get() method.

See https://kibana-ci.elastic.co/job/elastic+kibana+pull-request+multijob-intake/702/console

Chrome 51.0.2704 (Linux 0.0.0) discover field chooser directives Field listing should move the field into selected when it is added to the columns array FAILED
    Error: Unexpected request: POST /api/kibana/settings/shortDots:enable
    No more request expected
        at $httpBackend (http://localhost:5610/bundles/tests.bundle.js:78522:10)
        at sendReq (http://localhost:5610/bundles/tests.bundle.js:32906:10)
        at serverRequest (http://localhost:5610/bundles/tests.bundle.js:32613:17)
        at processQueue (http://localhost:5610/bundles/tests.bundle.js:37136:29)
        at http://localhost:5610/bundles/tests.bundle.js:37152:28
        at Scope.$eval (http://localhost:5610/bundles/tests.bundle.js:38380:29)
        at Scope.$digest (http://localhost:5610/bundles/tests.bundle.js:38191:32)
        at Context.<anonymous> (http://localhost:5610/bundles/tests.bundle.js:326085:15)

@epixa
Copy link
Contributor

epixa commented Aug 30, 2016

I ran this a couple times without a failure, so that's promising.

if (name === 'shortDots:enable') {
return false;
} else {
return origGet.call(this, name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're using arrow functions, I'm pretty sure this is going to bind origGet to the describe() context, which is the topmost non-arrow function. If binding isn't necessary, then just invoke it. If it is necessary, perhaps binding to $delegate would be more appropriate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch

Several tests have been failing recently with "Error: Unexpected request: POST /api/kibana/settings/shortDots:enable, No more request expected" which seems to be caused by the field chooser tests calling `config.set('shortDots:enable', origValue)` in the test cleanup task. Rather than investigate it further I avoided the need to call `config.set()` by stubbing the `config.get()` method.
@epixa epixa merged commit 401dea9 into elastic:master Aug 30, 2016
@spalger spalger deleted the fix/configRaceInTests branch September 9, 2016 23:12
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
remove config.set() call to avoid race

Former-commit-id: 401dea9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants