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

rollup jobs functional UI test can't be run twice #39135

Closed
LeeDr opened this issue Jun 17, 2019 · 5 comments
Closed

rollup jobs functional UI test can't be run twice #39135

LeeDr opened this issue Jun 17, 2019 · 5 comments
Labels
Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more test_xpack_functional test

Comments

@LeeDr
Copy link
Contributor

LeeDr commented Jun 17, 2019

Describe the feature: The existing test can only be run successfully once. If you try to run it again it fails for several reasons;

  1. We only have a data-test-subj createRollupJobButton on the empty rollup job page. If you run the test when there's an existing rollup job you get a job list view and the button on that page doesn't have the data-test-subj.

  2. The data-test-subj above is easy enough to fix, but the test still can't pass a second time because it would try to create a job with the same name and that's not allowed.

A. one option, is to add a test at the end which deletes the rollup job.

  • this tests a bit more functionality of the UI
  • but if it fails, it still could leave the job
  • I think we also would have to delete the rollup index

B. use unique job names (append date in milliseconds to it or something)

  • (still need to fix the data-test-subj issue)

"actively running jobs have their config in the cluster state. All jobs (active or otherwise) also have a copy of the config in the mapping _meta field of the rollup index"
"there's a pr up to add a flag to delete the config when deleting the job"

Here's a bit of changes I played around with to add the data-test-subj and to append a timestamp to the job name (but maybe should also append to the rollup job output index name?);

$ git diff
diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js
index eb204be89a..b6bfe0182f 100644
--- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js
+++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js
@@ -234,7 +234,7 @@ export class JobListUi extends Component {
           {this.getHeaderSection()}

           <EuiPageContentHeaderSection>
-            <EuiButton fill {...getRouterLinkProps(`${CRUD_APP_BASE_PATH}/create`)}>
+            <EuiButton data-test-subj="createRollupJobButton" fill {...getRouterLinkProps(`${CRUD_APP_BASE_PATH}/create`)}>
               <FormattedMessage
                 id="xpack.rollupJobs.jobList.createButtonLabel"
                 defaultMessage="Create rollup job"
diff --git a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js
index 0d87820874..82c4d23e61 100644
--- a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js
+++ b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js
@@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }) {
     after(async () => await esArchiver.unload('logstash_functional'));

     it('create and save a new job', async () => {
-      const jobName = 'Testjob1';
+      const jobName = 'Testjob_' + ((new Date).getTime());
       const indexPattern = '.kibana*';
       const indexName = 'rollup_index';
       const interval = '1000ms';

cc/ @cjcenizal @Rasroh

@LeeDr LeeDr added test test_xpack_functional Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Jun 17, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

@alisonelizabeth
Copy link
Contributor

@cuff-links does #43498 resolve this issue?

@cuff-links
Copy link
Contributor

@alisonelizabeth Yes it does.
@LeeDr Do you want to try running these tests back to back to see if #43498 suffices? I compensated for creating unique names for rollups using timestamps. Check it out and let me know.

@cuff-links
Copy link
Contributor

Closing this issue because #43948 fixes the issue. @LeeDr If I am wrong, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more test_xpack_functional test
Projects
None yet
Development

No branches or pull requests

4 participants