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-failed]: X-Pack API Integration Tests.x-pack/test/api_integration/apis/telemetry/opt_in·ts - apis Telemetry /api/telemetry/v2/optIn API should support sending false #51522

Closed
liza-mae opened this issue Nov 22, 2019 · 14 comments · Fixed by #61271
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Feature:Telemetry Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc test-cloud v7.7.0

Comments

@liza-mae
Copy link
Contributor

liza-mae commented Nov 22, 2019

Version: 7.5
Class: X-Pack API Integration Tests.x-pack/test/api_integration/apis/telemetry/opt_in·ts
Test Failures: 2
Other Tests:
X-Pack API Integration Tests.x-pack/test/api_integration/apis/telemetry/opt_in·ts.apis Telemetry /api/telemetry/v2/optIn API should support sending true

Stack Trace:
Error: expected 200 "OK", got 400 "Bad Request"
at Test._assertStatus (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/supertest/lib/test.js:268:12)
at Test._assertFunction (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/supertest/lib/test.js:283:11)
at Test.assert (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/supertest/lib/test.js:173:18)
at assert (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/supertest/lib/test.js:131:12)
at /var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/supertest/lib/test.js:128:5
at Test.Request.callback (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/superagent/lib/node/index.js:718:3)
at parser (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/superagent/lib/node/index.js:906:18)
at IncomingMessage.res.on (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/node/linux-immutable/ci/cloud/build/kibana/node_modules/superagent/lib/node/parsers/json.js:19:7)
at endReadableNT (_stream_readable.js:1103:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

Platform: cloud
Build Num: 24

@liza-mae liza-mae added failed-test A test failure on a tracked branch, potentially flaky-test test-cloud labels Nov 22, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-test-triage (failed-test)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-services (Team:Stack Services)

@elasticmachine
Copy link
Contributor

Pinging @elastic/pulse (Team:Pulse)

@Bamieh
Copy link
Member

Bamieh commented Dec 13, 2019

This will fail on cloud since we do not allow changing opt in status on cloud (configured via telemetry.allowChangingOptInStatus: false).

I believe at the moment this is only skipped for cloud, how can i double check? If so I believe we can close this.

@liza-mae
Copy link
Contributor Author

@Bamieh , thanks when you say we don't allowing changing opt in status on cloud, who is we? Would you say this is not something supported for a customer to do on cloud?

@Bamieh
Copy link
Member

Bamieh commented Jan 9, 2020

@liza-mae
this config is set by the cloud team on deployed kibana instances: telemetry.allowChangingOptInStatus: false

Cloud users cannot change this kibana config, hence cloud users will not be able to set opt_in to false via the API.

@liza-mae
Copy link
Contributor Author

liza-mae commented Jan 9, 2020

Thanks @Bamieh ! We should create a PR to skip this test for cloud then and reference this issue as the explanation as to why it is skipped.

@Bamieh
Copy link
Member

Bamieh commented Jan 9, 2020

@liza-mae awesome! where do we do that?

@liza-mae
Copy link
Contributor Author

liza-mae commented Jan 9, 2020

@Bamieh, in file for the following tests:

it('should support sending false', async () => {

it('should support sending true', async () => {

I was thinking instead of skipping them on cloud, we can verify these commands get rejected on cloud (gives us a better test scenario). We recently added an isCloud() method, so we can use something as follows:

if ((await PageObjects.common.isCloud())) {
await postTelemetryV2Optin(supertest, false, 400);
}
else ... do the rest of the test

@liza-mae
Copy link
Contributor Author

Version: 7.6
Class: X-Pack API Integration Tests.x-pack/test/api_integration/apis/telemetry/opt_in·ts
Stack Trace:
Error: expected 200 "OK", got 400 "Bad Request"
at Test._assertStatus (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:268:12)
at Test._assertFunction (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:283:11)
at Test.assert (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:173:18)
at assert (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:131:12)
at /var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:128:5
at Test.Request.callback (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/superagent/lib/node/index.js:718:3)
at parser (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/superagent/lib/node/index.js:906:18)
at IncomingMessage.res.on (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/superagent/lib/node/parsers/json.js:19:7)
at endReadableNT (_stream_readable.js:1143:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Platform: cloud
Build Num: 42

@liza-mae
Copy link
Contributor Author

liza-mae commented Jan 24, 2020

I had a case on staging (not the above) where this command POST /api/telemetry/v2/optIn actually succeeded with 200 response code, which is incorrect. The correct response is 400 {"error":"Not allowed to change Opt-in Status."}.
So making these test changes will help catch this type of failure and shows the value of having these checks.
I did verify the released version on production - did not have the problem. It also shows the value of running these tests on production.

Reference Results: elastic+estf-cloud-kibana-tests/41/testReport

@Bamieh
Copy link
Member

Bamieh commented Feb 4, 2020

@liza-mae added to fix in 7.7

@liza-mae
Copy link
Contributor Author

Version: 7.6.1
Class: X-Pack API Integration Tests.x-pack/test/api_integration/apis/telemetry/opt_in·ts
Stack Trace:
Error: expected 200 "OK", got 400 "Bad Request"
at Test._assertStatus (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:268:12)
at Test._assertFunction (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:283:11)
at Test.assert (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:173:18)
at assert (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:131:12)
at /var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/supertest/lib/test.js:128:5
at Test.Request.callback (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/superagent/lib/node/index.js:718:3)
at parser (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/superagent/lib/node/index.js:906:18)
at IncomingMessage.res.on (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/superagent/lib/node/parsers/json.js:19:7)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Platform: cloud
Build Num: 50

@lukeelmers lukeelmers added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Oct 1, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Feature:Telemetry Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc test-cloud v7.7.0
Projects
None yet
5 participants