## Summary
Fixes issues within Cypress whenever developers would re-run tests they could become blocked as some of the tests cause a migration/roll over of the signals.
To reproduce the error off of master:
Start Cypress
```ts
cd ./kibana/x-pack/plugins/security_solution
yarn cypress:open-as-ci
```
Then run the export test twice. The first time it will run ok. The second time the test will refuse to run.
<img width="585" alt="Screen Shot 2020-11-30 at 1 57 24 PM" src="https://user-images.githubusercontent.com/1151048/100683706-2233c200-3336-11eb-949f-48f86e884d8b.png">
The second time that you run the test you will get these errors from Cypress and will be blocked until you do workarounds such as logging into `https://localhost:5620` and manually changing the indexes manually or restarting Cypress altogether.
<img width="1067" alt="Screen Shot 2020-11-30 at 6 05 07 PM" src="https://user-images.githubusercontent.com/1151048/100683945-9a9a8300-3336-11eb-9d49-187dee4fc1dc.png">
What is going on with the errors is that a migration is occurring since the existing signals mapping for the tests are not the newer migrated version and these are creating a new index named `.siem-signals-default-0000002` like so:
<img width="1242" alt="Screen Shot 2020-11-30 at 1 57 12 PM" src="https://user-images.githubusercontent.com/1151048/100684145-fcf38380-3336-11eb-8fe1-b29d3462a1ae.png">
This index is not being cleaned up and when the next time we do an es_archive load we are marking two indexes as being writable
file: x-pack/test/security_solution_cypress/es_archives/alerts/mappings.json
```ts
".siem-signals-default": {
"is_write_index": true
}
},
"index": ".siem-signals-default-000001",
```
which leads to the stack trace and the Cypress errors on the front end:
```ts
MacBook-Pro.local] path: /.siem-signals-default-000001, params: {index=.siem-signals-default-000001}
│ java.lang.IllegalStateException: alias [.siem-signals-default] has more than one write index [.siem-signals-default-000002,.siem-signals-default-000001]
│ at org.elasticsearch.cluster.metadata.IndexAbstraction$Alias.computeAndValidateAliasProperties(IndexAbstraction.java:276) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
```
This fixes that by updating the mapping and migration number. Each time we migrate/change the signals mapping we will have to perform a PR like this to update each location.
At the moment this is 5 different locations we have to update with the latest mappings.
### Checklist
- [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
* added core features to kibana services
* Added test for alert form
* Added mocking of legacy shims and actions
* Fixed typing
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Adding delay between creating and updating alert to avoid 409 conflicts
* Unskipping update test
* Using retry.try instead of delay
* PR fixes
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* initial draft
* move components to their own files
* create services folder and move tags package
* add assignment service
* fix some types
* prepare assign tag route
* move server-side tag client under the `services` folder
* add security check, move a lot of stuff.
* design improvements
* display tags in flyout
* improve button and add notification on save
* add action on tag rows
* fix types
* fix mock import paths
* add lens to the list of assignable types
* update generated doc
* add base functional tests
* move api to internal
* add api/security test suites
* add / use get_assignable_types API
* fix feature control tests
* fix assignable types propagation
* rename actions folder to bulk_actions
* extract actions to their own module
* add common / server unit tests
* add client-side assign tests
* add some tests and tsdoc
* typo
* add getActions test
* revert width change
* fix typo in API
* various minor improvements
* typo
* tsdoc on flyout page object
* close flyout when leaving the page
* fix bug when redirecting to SO management with a tag having whitespaces in its name
* check for dupes in toAdd and toRemove
* add lazy load to assign modal opener
* add lazy load to edit/create modals
* check if at least one assign or unassign tag id is specified
* grammar
* add explicit type existence check
* Added server-side endpoint for getting list of repos
* part one of client side changes: added searchable snapshot field
- added to both hot and cold
- serializing into JSON payload
* make searchable snapshot field toggleable and require value when it is being used
* fix typo in file name and remove whitespace
* added searchable snapshot state context, wip
* finished updating fields to show and hide based on searchable snapshot in the hot phase
* hiding fields when searchable snapshots is enabled in hot
- removed nested EuiFieldRow components in data allocation field
- added SCSS files for data allocation field and searchable
snapshot field
* added translations and a first hot phase serialization test
* appease type check and i18n
* added cloud-specific behaviour for searchable snapshot default inlc. test
* refactor snapshot state -> configuration issues as this a can be re-used for other issues
* added configuration context file
* hide replicas in cold if snapshotting
* updated new field copy
* update test coverage, test for hiding certain fields too
* added license check to client side!
* moved warning to below field again and moved hot phase searchable snapshot notice to right
* make described form field lazy if needed
* render field even when license requirement is not met
* update serializer for removing searchable_snapshot field
* handle 404 from ES when looking up * snapshot repos - we return an empty array
* address license TODO
* added tests for license check and removed license check HoC
* fix legacy jest tests
* added readme about legacy tests
* updated jest tests and fix type issues
* remove unused import
* refactor component names to have "Field" at the end
* refactor searchable snapshot to single interface def and add comment about force_merge_index option
* address stakeholder feebdack and pr comments
* update tests after latest changes
* link to force merge
* Revert "link to force merge"
This reverts commit 6c714fbbac.
* introduce advanced section to hot, warm and cold
* added test for correctly deserializing delete phase, and added fix
* remove unused variable
* moved fields into advanced settings
* move learn more copy below enable toggle
* fix warm phase on rollover default
* remove label space above rollover toggle
* remove unused import
* update test after fixing warm on rollover default
* removed icons in callouts in searchable snapshot field, added ability to control field toggles
* move callouts to description text
* readd warning callouts to the searchable snapshot field
* slight i18n adjustment
* made callout for actions disabled a bit smaller
* fix i18n
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>