Skip to content

[7.x] [Security Solutions][Detection Engine] Adds e2e FTR runtime support and 213 tests for exception lists (#83764)#83967

Merged
FrankHassanabad merged 1 commit intoelastic:7.xfrom
FrankHassanabad:backport/7.x/pr-83764
Nov 20, 2020
Merged

[7.x] [Security Solutions][Detection Engine] Adds e2e FTR runtime support and 213 tests for exception lists (#83764)#83967
FrankHassanabad merged 1 commit intoelastic:7.xfrom
FrankHassanabad:backport/7.x/pr-83764

Conversation

@FrankHassanabad
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

…nd 213 tests for exception lists (elastic#83764)

## Summary

Adds support to the end to end (e2e) functional test runner (FTR) support for rule runtime tests as well as 213 tests for the exception lists which include value based lists. Previously we had limited runtime support, but as I scaled up runtime tests from 5 to 200+ I noticed in a lot of areas we had to use improved techniques for determinism.

The runtime support being added is our next step of tests. Up to now most of our e2e FTR tests have been structural testing of REST and API integration tests. Basically up to now 95% tests are API structural as:

* Call REST input related to a rule such as GET/PUT/POST/PATCH/DELETE.
* Check REST output of the rule, did it match expected output body and status code?
* In some rare cases we check if the the rule can be executed and we get a status of 'succeeded'

With only a small part of our tests ~5%, `generating_signals.ts` was checking the signals being produced. However, we cannot have confidence in runtime based tests until the structural tests have been built up and run through the weeks against PR's to ensure that those are stable and deterministic.

Now that we have confidence and 90%+ coverage of the structural REST based tests, we are building up newer sets of tests which allow us to do runtime based validation tests to increase confidence that:

* Detection engine produces signals as expected
* Structure of the signals are as expected, including signal on signals
* Exceptions to signals are working as expected
* Most runtime bugs can be TDD'ed with e2e FTR's and regressions
* Whack-a-mole will not happen
* Consistency and predictability of signals is validated
* Refactoring can occur with stronger confidence
* Runtime tests are reference points for answering questions about existing bugs or adding new ones to test if users are experiencing unexpected behaviors  
* Scaling tests can happen without failures
* Velocity for creating tests increases as the utilities and examples increase

Lastly, this puts us within striking distance of creating FTR's for different common class of runtime situations such as:
* Creating tests that exercise each rule against a set of data criteria and get signal hits
* Creating tests that validate the rule overrides operate as expected against data sets
* Creating tests that validate malfunctions, corner cases, or misuse cases such as data sets that are _all_ arrays or data sets that put numbers as strings or throws in an expected `null` instead of a value. 

These tests follow the pattern of:
* Add the smallest data set to a folder in data.json (not gzip format)
* Add the smallest mapping to that folder (mapping.json) 
* Call REST input related to exception lists, value lists, adding prepackaged rules, etc...
* Call REST input related endpoint with utilities to create and activate the rule
* Wait for the rule to go into the `succeeded` phase
* Wait for the N exact signals specific to that rule to be available
* Check against the set of signals to ensure that the matches are exactly as expected 

Example of one runtime test:

A keyword data set is added to a folder called "keyword" but you can add one anywhere you want under `es_archives`, I just grouped mine depending on the situation of the runtime. Small non-gzipped tests `data.json` and `mappings.json` are the best approach for small focused tests. For _larger_ tests and cases I would and sometimes do use things such as auditbeat but try to avoid using larger data sets in favor of smaller focused test cases to validate the runtime is operating as expected.

```ts
{
  "type": "doc",
  "value": {
    "id": "1",
    "index": "long",
    "source": {
      "@timestamp": "2020-10-28T05:00:53.000Z",
      "long": 1
    },
    "type": "_doc"
  }
}

{
  "type": "doc",
  "value": {
    "id": "2",
    "index": "long",
    "source": {
      "@timestamp": "2020-10-28T05:01:53.000Z",
      "long": 2
    },
    "type": "_doc"
  }
}

{
  "type": "doc",
  "value": {
    "id": "3",
    "index": "long",
    "source": {
      "@timestamp": "2020-10-28T05:02:53.000Z",
      "long": 3
    },
    "type": "_doc"
  }
}

{
  "type": "doc",
  "value": {
    "id": "4",
    "index": "long",
    "source": {
      "@timestamp": "2020-10-28T05:03:53.000Z",
      "long": 4
    },
    "type": "_doc"
  }
}
```

Mapping is added. Note that this is "ECS tolerant" but not necessarily all ECS meaning I can and will try to keep things simple where I can, but I have ensured that  `"@timestamp"` is at least there.

```ts
{
  "type": "index",
  "value": {
    "index": "long",
    "mappings": {
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "long": { "type": "long" }
      }
    },
    "settings": {
      "index": {
        "number_of_replicas": "1",
        "number_of_shards": "1"
      }
    }
  }
}
```

Test is written with test utilities where the `beforeEach` and `afterEach` try and clean up the indexes and load/unload the archives to keep one test from effecting another. Note this is never going to be 100% possible so see below on how we add more determinism in case something escapes the sandbox. 
```ts
    beforeEach(async () => {
      await createSignalsIndex(supertest);
      await createListsIndex(supertest);
      await esArchiver.load('rule_exceptions/keyword');
    });

    afterEach(async () => {
      await deleteSignalsIndex(supertest);
      await deleteAllAlerts(supertest);
      await deleteAllExceptions(es);
      await deleteListsIndex(supertest);
      await esArchiver.unload('rule_exceptions/keyword');
    });

    describe('"is" operator', () => {
      it('should filter 1 single keyword if it is set as an exception', async () => {
        const rule = getRuleForSignalTesting(['keyword']);
        const { id } = await createRuleWithExceptionEntries(supertest, rule, [
          [
            {
              field: 'keyword',
              operator: 'included',
              type: 'match',
              value: 'word one',
            },
          ],
        ]);
        await waitForRuleSuccess(supertest, id);
        await waitForSignalsToBePresent(supertest, 3, [id]);
        const signalsOpen = await getSignalsById(supertest, id);
        const hits = signalsOpen.hits.hits.map((hit) => hit._source.keyword).sort();
        expect(hits).to.eql(['word four', 'word three', 'word two']);
      });
   });
```

### Changes for better determinism
To support more determinism there are changes and utilities added which can be tuned during any sporadic failures we might encounter as well as better support unexpected changes to other Elastic Stack pieces such as alerting, task manager, etc...

Get simple rule and others are now defaulting to false, meaning that the structural tests will no longer activate a rule and run it on task manger. This should cut down on error outputs as well as reduce stress and potentials for left over rules interfering with the runtime rules. 
```ts
export const getSimpleRule = (ruleId = 'rule-1', enabled = false): QueryCreateSchema => ({
```

Not mandatory to use, but for most tests that should be runtime based tests, I use this function below which will enable it by default and run it using settings such as `type: 'query'`, `query: '*:*',` `from: '1900-01-01T00:00:00.000Z'`, to cut down on boiler plate noise. However, people can use whatever they want out of the grab bag or if their test is more readable to hand craft a REST request to create signals, or if they just want to call this and override where they want to, then 👍 .
 ```ts
export const getRuleForSignalTesting = (index: string[], ruleId = 'rule-1', enabled = true)
```

This waits for a rule to succeed before continuing
```ts
await waitForRuleSuccess(supertest, id);
```

I added a required array of id that _waits_ only for that particular id here. This is useful in case another test did not cleanup and you are getting signals being produced or left behind but need to wait specifically for yours.
```ts
await waitForSignalsToBePresent(supertest, 4, [id]);
```

I only get the signals for a particular rule id using either the auto-generated id or the rule_id. It's safer to use the ones from the auto-generated id but either of these are fine if you're careful enough. 
```ts
const signalsOpen = await getSignalsById(supertest, id);
const signalsOpen = await getSignalsByIds(supertest, [createdId]);
const signalsOpen = await getSignalsByRuleIds(supertest, ['signal-on-signal']);
```

I delete all alerts now through a series of steps where it properly removes all rules using the rules bulk_delete and does it in such a way that all the API keys and alerting will be the best it can destroyed as well as double check that the alerts are showing up as being cleaned up before continuing.
```ts
deleteAllAlerts()
```

When not explicitly testing something structural, prefer to use the utilities which can and will do retries in case there are over the wire failures or es failures. Examples are:
```ts
installPrePackagedRules()
waitForRuleSuccess()
importFile() // This does a _lot_ of checks to ensure that the file is fully imported before continuing
```

Some of these utilities might still do a `expect(200);` but as we are and should use regular structural tests to cover those problems, these will probably be more and more removed when/if we hit test failures in favor of doing retries, waitFor, and countDowns.

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
@FrankHassanabad FrankHassanabad added the backport This PR is a backport of another PR label Nov 20, 2020
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky


Test Failures

Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/drilldowns/dashboard_to_dashboard_drilldown·ts.dashboard drilldowns Dashboard to dashboard drilldown Copy to space Dashboards linked by a drilldown are both copied to a space

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://github.com/elastic/kibana/issues/83824

[00:00:00]       │
[00:00:00]         └-: dashboard
[00:00:00]           └-> "before all" hook
[00:10:54]           └-: drilldowns
[00:10:54]             └-> "before all" hook
[00:10:54]             └-> "before all" hook
[00:10:54]               │ info [logstash_functional] Loading "mappings.json"
[00:10:54]               │ info [logstash_functional] Loading "data.json.gz"
[00:10:54]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.22"
[00:10:54]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.20"
[00:10:54]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.21"
[00:10:55]               │ info [dashboard/drilldowns] Loading "mappings.json"
[00:10:55]               │ info [dashboard/drilldowns] Loading "data.json"
[00:10:55]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_2/QJI30cm4Tz2hNB0OgGziWw] deleting index
[00:10:55]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_1/b6yjiWMoRfetbnNffbWJ_A] deleting index
[00:10:55]               │ info [dashboard/drilldowns] Deleted existing index [".kibana_2",".kibana_1"]
[00:10:55]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana] creating index, cause [api], templates [], shards [1]/[1]
[00:10:55]               │ info [dashboard/drilldowns] Created index ".kibana"
[00:10:55]               │ debg [dashboard/drilldowns] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:10:55]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana/vZFs6RQ2QmKp6jQAiiuZPg] update_mapping [_doc]
[00:10:55]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana/vZFs6RQ2QmKp6jQAiiuZPg] update_mapping [_doc]
[00:10:55]               │ info [dashboard/drilldowns] Indexed 12 docs into ".kibana"
[00:10:55]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana/vZFs6RQ2QmKp6jQAiiuZPg] update_mapping [_doc]
[00:10:55]               │ debg Migrating saved objects
[00:10:55]               │ proc [kibana]   log   [19:53:17.928] [info][savedobjects-service] Creating index .kibana_2.
[00:10:55]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1]
[00:10:55]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] updating number_of_replicas to [0] for indices [.kibana_2]
[00:10:55]               │ proc [kibana]   log   [19:53:18.014] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:10:55]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1]
[00:10:55]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] updating number_of_replicas to [0] for indices [.kibana_1]
[00:10:55]               │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] 13702 finished with response BulkByScrollResponse[took=29.8ms,timed_out=false,sliceId=null,updated=0,created=12,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:10:56]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana/vZFs6RQ2QmKp6jQAiiuZPg] deleting index
[00:10:56]               │ proc [kibana]   log   [19:53:18.376] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:10:56]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_2/1pQIR6O2T0WxJO3p8qO-EQ] update_mapping [_doc]
[00:10:56]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_2/1pQIR6O2T0WxJO3p8qO-EQ] update_mapping [_doc]
[00:10:56]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_2/1pQIR6O2T0WxJO3p8qO-EQ] update_mapping [_doc]
[00:10:56]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_2/1pQIR6O2T0WxJO3p8qO-EQ] update_mapping [_doc]
[00:10:56]               │ proc [kibana]   log   [19:53:18.614] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:10:56]               │ proc [kibana]   log   [19:53:18.651] [info][savedobjects-service] Finished in 725ms.
[00:10:56]               │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:10:56]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xxl-1605899505016394244] [.kibana_2/1pQIR6O2T0WxJO3p8qO-EQ] update_mapping [_doc]
[00:10:57]               │ debg replacing kibana config doc: {"defaultIndex":"logstash-*"}
[00:10:58]             └-: Dashboard to dashboard drilldown
[00:10:58]               └-> "before all" hook
[00:12:45]               └-: Copy to space
[00:12:45]                 └-> "before all" hook
[00:12:45]                 └-> "before all" hook
[00:12:45]                   │ debg creating space
[00:12:45]                   │ debg created space
[00:12:45]                   │ debg navigating to settings url: http://localhost:6111/app/management
[00:12:45]                   │ debg navigate to: http://localhost:6111/app/management
[00:12:46]                   │ERROR browser[SEVERE] http://localhost:6111/36692/bundles/plugin/visualizations/visualizations.plugin.js 5:96009 Error: Saved field "@timestamp" of index pattern "logstash-*" is invalid for use with the "Date Histogram" aggregation. Please select a new field.
[00:12:46]                   │          at FieldParamType.deserialize (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:616638)
[00:12:46]                   │          at http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:404023
[00:12:46]                   │          at Array.forEach (<anonymous>)
[00:12:46]                   │          at AggConfig.setParams (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:403447)
[00:12:46]                   │          at AggConfig.set type [as type] (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:409226)
[00:12:46]                   │          at AggConfig.setType (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:409326)
[00:12:46]                   │          at new AggConfig (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:403245)
[00:12:46]                   │          at agg_configs_AggConfigs.createAggConfig (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:185451)
[00:12:46]                   │          at http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:185803
[00:12:46]                   │          at Array.forEach (<anonymous>)
[00:12:46]                   │ debg browser[INFO] http://localhost:6111/app/management?_t=1605902108141 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:12:46]                   │
[00:12:46]                   │ debg browser[INFO] http://localhost:6111/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:12:46]                   │ debg ... sleep(700) start
[00:12:47]                   │ debg ... sleep(700) end
[00:12:47]                   │ debg returned from get, calling refresh
[00:12:47]                   │ debg browser[INFO] http://localhost:6111/app/management?_t=1605902108141 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:12:47]                   │
[00:12:47]                   │ debg browser[INFO] http://localhost:6111/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:12:47]                   │ debg currentUrl = http://localhost:6111/app/management
[00:12:47]                   │          appUrl = http://localhost:6111/app/management
[00:12:47]                   │ debg TestSubjects.find(kibanaChrome)
[00:12:47]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:12:48]                   │ debg ... sleep(501) start
[00:12:48]                   │ debg ... sleep(501) end
[00:12:48]                   │ debg in navigateTo url = http://localhost:6111/app/management
[00:12:48]                   │ debg TestSubjects.exists(statusPageContainer)
[00:12:48]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:12:51]                   │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:12:51]                   │ debg TestSubjects.click(objects)
[00:12:51]                   │ debg Find.clickByCssSelector('[data-test-subj="objects"]') with timeout=10000
[00:12:51]                   │ debg Find.findByCssSelector('[data-test-subj="objects"]') with timeout=10000
[00:12:51]                   │ debg Find.existsByDisplayedByCssSelector('*[data-test-subj="savedObjectsTable"] :not(.euiBasicTable-loading)') with timeout=2500
[00:12:52]                   │ debg --- retry.tryForTime error: stale element reference: element is not attached to the page document
[00:12:52]                   │        (Session info: headless chrome=87.0.4280.66)
[00:13:00]                 └-> Dashboards linked by a drilldown are both copied to a space
[00:13:00]                   └-> "before each" hook: global before each
[00:13:00]                   │ debg TestSubjects.find(savedObjectSearchBar)
[00:13:00]                   │ debg Find.findByCssSelector('[data-test-subj="savedObjectSearchBar"]') with timeout=10000
[00:13:01]                   │ debg isGlobalLoadingIndicatorVisible
[00:13:01]                   │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:01]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:02]                   │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:03]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:03]                   │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:03]                   │ debg Find.existsByDisplayedByCssSelector('*[data-test-subj="savedObjectsTable"] :not(.euiBasicTable-loading)') with timeout=2500
[00:13:04]                   │ debg ... sleep(1000) start
[00:13:05]                   │ debg ... sleep(1000) end
[00:13:05]                   │ debg TestSubjects.findAll(~savedObjectsTableRow)
[00:13:05]                   │ debg Find.allByCssSelector('[data-test-subj~="savedObjectsTableRow"]') with timeout=10000
[00:13:05]                   │ debg we found a context menu element for (Dashboard With Area Chart) so click it
[00:13:06]                   │ debg Find.findByCssSelector('.euiContextMenuPanel') with timeout=10000
[00:13:06]                   │ debg TestSubjects.exists(copy-to-space-flyout)
[00:13:06]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="copy-to-space-flyout"]') with timeout=120000
[00:13:06]                   │ debg TestSubjects.find(cts-copyModeControl-overwriteRadioGroup)
[00:13:06]                   │ debg Find.findByCssSelector('[data-test-subj="cts-copyModeControl-overwriteRadioGroup"]') with timeout=10000
[00:13:06]                   │ debg TestSubjects.click(cts-space-selector-row-custom_space)
[00:13:06]                   │ debg Find.clickByCssSelector('[data-test-subj="cts-space-selector-row-custom_space"]') with timeout=10000
[00:13:06]                   │ debg Find.findByCssSelector('[data-test-subj="cts-space-selector-row-custom_space"]') with timeout=10000
[00:13:06]                   │ debg TestSubjects.click(cts-initiate-button)
[00:13:06]                   │ debg Find.clickByCssSelector('[data-test-subj="cts-initiate-button"]') with timeout=10000
[00:13:06]                   │ debg Find.findByCssSelector('[data-test-subj="cts-initiate-button"]') with timeout=10000
[00:13:06]                   │ debg Find.waitForDeletedByCssSelector('[data-test-subj="cts-summary-indicator-loading-custom_space"]') with timeout=10000
[00:13:07]                   │ debg TestSubjects.exists(cts-summary-indicator-success-custom_space)
[00:13:07]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="cts-summary-indicator-success-custom_space"]') with timeout=120000
[00:13:07]                   │ debg TestSubjects.getVisibleText(cts-summary-success-count)
[00:13:07]                   │ debg TestSubjects.find(cts-summary-success-count)
[00:13:07]                   │ debg Find.findByCssSelector('[data-test-subj="cts-summary-success-count"]') with timeout=10000
[00:13:07]                   │ debg TestSubjects.getVisibleText(cts-summary-pending-count)
[00:13:07]                   │ debg TestSubjects.find(cts-summary-pending-count)
[00:13:07]                   │ debg Find.findByCssSelector('[data-test-subj="cts-summary-pending-count"]') with timeout=10000
[00:13:07]                   │ debg TestSubjects.getVisibleText(cts-summary-skipped-count)
[00:13:07]                   │ debg TestSubjects.find(cts-summary-skipped-count)
[00:13:07]                   │ debg Find.findByCssSelector('[data-test-subj="cts-summary-skipped-count"]') with timeout=10000
[00:13:07]                   │ debg TestSubjects.getVisibleText(cts-summary-error-count)
[00:13:07]                   │ debg TestSubjects.find(cts-summary-error-count)
[00:13:07]                   │ debg Find.findByCssSelector('[data-test-subj="cts-summary-error-count"]') with timeout=10000
[00:13:07]                   │ debg TestSubjects.click(cts-finish-button)
[00:13:07]                   │ debg Find.clickByCssSelector('[data-test-subj="cts-finish-button"]') with timeout=10000
[00:13:07]                   │ debg Find.findByCssSelector('[data-test-subj="cts-finish-button"]') with timeout=10000
[00:13:07]                   │ debg Find.waitForDeletedByCssSelector('[data-test-subj="copy-to-space-flyout"]') with timeout=10000
[00:13:07]                   │ debg navigating to dashboard url: http://localhost:6111/s/custom_space/app/dashboards#/list
[00:13:07]                   │ debg navigate to: http://localhost:6111/s/custom_space/app/dashboards#/list
[00:13:08]                   │ debg browser[INFO] http://localhost:6111/s/custom_space/app/dashboards?_t=1605902130111#/list 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:13:08]                   │
[00:13:08]                   │ debg browser[INFO] http://localhost:6111/s/custom_space/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:13:08]                   │ debg ... sleep(700) start
[00:13:08]                   │ debg ... sleep(700) end
[00:13:08]                   │ debg returned from get, calling refresh
[00:13:09]                   │ERROR browser[SEVERE] http://localhost:6111/36692/bundles/core/core.entry.js 12:193158 TypeError: Failed to fetch
[00:13:09]                   │          at _callee3$ (http://localhost:6111/36692/bundles/core/core.entry.js:6:43940)
[00:13:09]                   │          at l (http://localhost:6111/36692/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321:1751406)
[00:13:09]                   │          at Generator._invoke (http://localhost:6111/36692/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321:1751159)
[00:13:09]                   │          at Generator.forEach.e.<computed> [as throw] (http://localhost:6111/36692/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321:1751763)
[00:13:09]                   │          at fetch_asyncGeneratorStep (http://localhost:6111/36692/bundles/core/core.entry.js:6:38998)
[00:13:09]                   │          at _throw (http://localhost:6111/36692/bundles/core/core.entry.js:6:39406)
[00:13:09]                   │ debg browser[INFO] http://localhost:6111/s/custom_space/app/dashboards?_t=1605902130111#/list 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:13:09]                   │
[00:13:09]                   │ debg browser[INFO] http://localhost:6111/s/custom_space/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:13:09]                   │ debg currentUrl = http://localhost:6111/s/custom_space/app/dashboards#/list
[00:13:09]                   │          appUrl = http://localhost:6111/s/custom_space/app/dashboards#/list
[00:13:09]                   │ debg TestSubjects.find(kibanaChrome)
[00:13:09]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:13:09]                   │ debg ... sleep(501) start
[00:13:10]                   │ debg ... sleep(501) end
[00:13:10]                   │ debg in navigateTo url = http://localhost:6111/s/custom_space/app/dashboards#/list?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:13:10]                   │ debg --- retry.try error: URL changed, waiting for it to settle
[00:13:10]                   │ debg ... sleep(501) start
[00:13:11]                   │ debg ... sleep(501) end
[00:13:11]                   │ debg in navigateTo url = http://localhost:6111/s/custom_space/app/dashboards#/list?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:13:11]                   │ debg TestSubjects.exists(statusPageContainer)
[00:13:11]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:13:13]                   │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:13:14]                   │ debg isGlobalLoadingIndicatorVisible
[00:13:14]                   │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:14]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:14]                   │ debg browser[INFO] http://localhost:6111/s/custom_space/app/dashboards#/list?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now)) 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:13:14]                   │
[00:13:14]                   │ debg browser[INFO] http://localhost:6111/s/custom_space/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:13:16]                   │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:17]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:17]                   │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:17]                   │ debg Load Saved Dashboard Dashboard With Area Chart
[00:13:17]                   │ debg gotoDashboardLandingPage
[00:13:17]                   │ debg onDashboardLandingPage
[00:13:17]                   │ debg TestSubjects.exists(dashboardLandingPage)
[00:13:17]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="dashboardLandingPage"]') with timeout=5000
[00:13:17]                   │ debg searchForItemWithName: Dashboard With Area Chart
[00:13:17]                   │ debg TestSubjects.find(tableListSearchBox)
[00:13:17]                   │ debg Find.findByCssSelector('[data-test-subj="tableListSearchBox"]') with timeout=10000
[00:13:17]                   │ debg isGlobalLoadingIndicatorVisible
[00:13:17]                   │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:17]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:19]                   │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:19]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:19]                   │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:19]                   │ debg TestSubjects.click(dashboardListingTitleLink-Dashboard-With-Area-Chart)
[00:13:19]                   │ debg Find.clickByCssSelector('[data-test-subj="dashboardListingTitleLink-Dashboard-With-Area-Chart"]') with timeout=10000
[00:13:19]                   │ debg Find.findByCssSelector('[data-test-subj="dashboardListingTitleLink-Dashboard-With-Area-Chart"]') with timeout=10000
[00:13:19]                   │ debg isGlobalLoadingIndicatorVisible
[00:13:19]                   │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:19]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:21]                   │ERROR browser[SEVERE] http://localhost:6111/36692/bundles/plugin/visualizations/visualizations.plugin.js 5:96009 Error: Saved field "@timestamp" of index pattern "logstash-*" is invalid for use with the "Date Histogram" aggregation. Please select a new field.
[00:13:21]                   │          at FieldParamType.deserialize (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:616638)
[00:13:21]                   │          at http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:404023
[00:13:21]                   │          at Array.forEach (<anonymous>)
[00:13:21]                   │          at AggConfig.setParams (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:403447)
[00:13:21]                   │          at AggConfig.set type [as type] (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:409226)
[00:13:21]                   │          at AggConfig.setType (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:409326)
[00:13:21]                   │          at new AggConfig (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:403245)
[00:13:21]                   │          at agg_configs_AggConfigs.createAggConfig (http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:185451)
[00:13:21]                   │          at http://localhost:6111/36692/bundles/plugin/data/data.plugin.js:1:185803
[00:13:21]                   │          at Array.forEach (<anonymous>)
[00:13:21]                   │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:21]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:21]                   │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:21]                   │ debg TestSubjects.missingOrFail(dashboardLandingPage)
[00:13:21]                   │ debg Find.waitForDeletedByCssSelector('[data-test-subj="dashboardLandingPage"]') with timeout=10000
[00:13:22]                   │ debg isGlobalLoadingIndicatorVisible
[00:13:22]                   │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:22]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:23]                   │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:24]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:24]                   │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:24]                   │ debg waitForRenderComplete
[00:13:24]                   │ debg in getSharedItemsCount
[00:13:24]                   │ debg Find.findByCssSelector('[data-shared-items-count]') with timeout=10000
[00:13:24]                   │ debg Renderable.waitForRender for 1 elements
[00:13:24]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:13:34]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:13:44]                   │ debg --- retry.try error: 0 elements completed rendering, still waiting on a total of 1
[00:13:44]                   │                      specifically:
[00:13:44]                   │
[00:13:44]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:13:54]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:04]                   │ debg --- retry.try failed again with the same message...
[00:14:05]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:15]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:25]                   │ debg --- retry.try failed again with the same message...
[00:14:26]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:36]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:46]                   │ debg --- retry.try failed again with the same message...
[00:14:46]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:56]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:15:06]                   │ debg --- retry.try failed again with the same message...
[00:15:07]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:15:17]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:15:27]                   │ debg --- retry.try failed again with the same message...
[00:15:27]                   │ info Taking screenshot "/dev/shm/workspace/parallel/1/kibana/x-pack/test/functional/screenshots/failure/dashboard drilldowns Dashboard to dashboard drilldown Copy to space Dashboards linked by a drilldown are both copied to a space.png"
[00:15:27]                   │ info Current URL is: http://localhost:6111/s/custom_space/app/dashboards#/view/24f3f950-69d9-11ea-a14d-e341629a29e6?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272015-09-19T17:34:10.297Z%27,to:%272015-09-23T00:09:17.180Z%27))&_a=(description:%27%27,filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:%27%27),tags:!(),timeRestore:!t,title:%27Dashboard%20With%20Area%20Chart%27,viewMode:view)
[00:15:27]                   │ info Saving page source to: /dev/shm/workspace/parallel/1/kibana/x-pack/test/functional/failure_debug/html/dashboard drilldowns Dashboard to dashboard drilldown Copy to space Dashboards linked by a drilldown are both copied to a space.html
[00:15:27]                   └- ✖ fail: dashboard drilldowns Dashboard to dashboard drilldown Copy to space Dashboards linked by a drilldown are both copied to a space
[00:15:27]                   │      retry.try timeout: Error: 0 elements completed rendering, still waiting on a total of 1
[00:15:27]                   │                 specifically:
[00:15:27]                   │ 
[00:15:27]                   │     at /dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:50:17
[00:15:27]                   │     at runMicrotasks (<anonymous>)
[00:15:27]                   │     at processTicksAndRejections (internal/process/task_queues.js:97:5)
[00:15:27]                   │     at runAttempt (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:38:15)
[00:15:27]                   │     at retryForSuccess (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:77:21)
[00:15:27]                   │     at Retry.try (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry.ts:43:14)
[00:15:27]                   │     at Renderable.waitForRender (/dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:41:7)
[00:15:27]                   │     at DashboardPage.waitForRenderComplete (/dev/shm/workspace/parallel/1/kibana/test/functional/page_objects/dashboard_page.ts:485:7)
[00:15:27]                   │     at Context.<anonymous> (/dev/shm/workspace/parallel/1/kibana/x-pack/test/functional/apps/dashboard/drilldowns/dashboard_to_dashboard_drilldown.ts:203:9)
[00:15:27]                   │     at Object.apply (/dev/shm/workspace/parallel/1/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)
[00:15:27]                   │   Error: retry.try timeout: Error: 0 elements completed rendering, still waiting on a total of 1
[00:15:27]                   │                   specifically:
[00:15:27]                   │   
[00:15:27]                   │       at /dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:50:17
[00:15:27]                   │       at runMicrotasks (<anonymous>)
[00:15:27]                   │       at processTicksAndRejections (internal/process/task_queues.js:97:5)
[00:15:27]                   │       at runAttempt (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:38:15)
[00:15:27]                   │       at retryForSuccess (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:77:21)
[00:15:27]                   │       at Retry.try (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry.ts:43:14)
[00:15:27]                   │       at Renderable.waitForRender (/dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:41:7)
[00:15:27]                   │       at DashboardPage.waitForRenderComplete (/dev/shm/workspace/parallel/1/kibana/test/functional/page_objects/dashboard_page.ts:485:7)
[00:15:27]                   │       at Context.<anonymous> (test/functional/apps/dashboard/drilldowns/dashboard_to_dashboard_drilldown.ts:203:9)
[00:15:27]                   │       at Object.apply (/dev/shm/workspace/parallel/1/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)
[00:15:27]                   │       at onFailure (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:28:9)
[00:15:27]                   │       at retryForSuccess (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:68:13)
[00:15:27]                   │       at Retry.try (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry.ts:43:14)
[00:15:27]                   │       at Renderable.waitForRender (/dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:41:7)
[00:15:27]                   │       at DashboardPage.waitForRenderComplete (/dev/shm/workspace/parallel/1/kibana/test/functional/page_objects/dashboard_page.ts:485:7)
[00:15:27]                   │       at Context.<anonymous> (test/functional/apps/dashboard/drilldowns/dashboard_to_dashboard_drilldown.ts:203:9)
[00:15:27]                   │       at Object.apply (/dev/shm/workspace/parallel/1/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)
[00:15:27]                   │ 
[00:15:27]                   │ 

Stack Trace

Error: retry.try timeout: Error: 0 elements completed rendering, still waiting on a total of 1
                specifically:

    at /dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:50:17
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at runAttempt (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:38:15)
    at retryForSuccess (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:77:21)
    at Retry.try (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry.ts:43:14)
    at Renderable.waitForRender (/dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:41:7)
    at DashboardPage.waitForRenderComplete (/dev/shm/workspace/parallel/1/kibana/test/functional/page_objects/dashboard_page.ts:485:7)
    at Context.<anonymous> (test/functional/apps/dashboard/drilldowns/dashboard_to_dashboard_drilldown.ts:203:9)
    at Object.apply (/dev/shm/workspace/parallel/1/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)
    at onFailure (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:28:9)
    at retryForSuccess (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry_for_success.ts:68:13)
    at Retry.try (/dev/shm/workspace/parallel/1/kibana/test/common/services/retry/retry.ts:43:14)
    at Renderable.waitForRender (/dev/shm/workspace/parallel/1/kibana/test/functional/services/renderable.ts:41:7)
    at DashboardPage.waitForRenderComplete (/dev/shm/workspace/parallel/1/kibana/test/functional/page_objects/dashboard_page.ts:485:7)
    at Context.<anonymous> (test/functional/apps/dashboard/drilldowns/dashboard_to_dashboard_drilldown.ts:203:9)
    at Object.apply (/dev/shm/workspace/parallel/1/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)

Metrics [docs]

✅ unchanged

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

@FrankHassanabad FrankHassanabad merged commit 4652dee into elastic:7.x Nov 20, 2020
@FrankHassanabad FrankHassanabad deleted the backport/7.x/pr-83764 branch November 20, 2020 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants