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

Failing test: Jest Integration Tests.src/core/server/integration_tests/saved_objects/migrations/group3 - migration v2 - read batch size does not reduce the read batchSize in half if no batches exceeded maxReadBatchSizeBytes #163255

Open
kibanamachine opened this issue Aug 7, 2023 · 39 comments
Assignees
Labels
blocker failed-es-promotion failed-test A test failure on a tracked branch, potentially flaky-test skipped-test Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v9.0.0

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Aug 7, 2023

A test failed on a tracked branch

Jest encountered an unexpected token

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

By default "node_modules" folder is ignored by transformers.

Here's what you can do:
 • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
 • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation

Details:

SyntaxError: /var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/x-pack/plugins/cases/common/ui/types.ts: Identifier 'CaseMetricsFeature' has already been declared. (39:2)

  37 |   UserActionFindRequestTypes,
  38 |   UserActionFindResponse,
> 39 |   CaseMetricsFeature,
     |   ^
  40 |   CasesMetricsResponse,
  41 |   SingleCaseMetricsResponse,
  42 | } from '../types/api';
    at instantiate (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parse-error/credentials.ts:62:21)
    at instantiate (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parse-error.ts:60:12)
    at TypeScriptParserMixin.toParseError [as raise] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/tokenizer/index.ts:1464:19)
    at TypeScriptScopeHandler.raise [as declareName] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/plugins/typescript/scope.ts:83:21)
    at TypeScriptParserMixin.declareName [as declareNameFromIdentifier] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/lval.ts:705:16)
    at TypeScriptParserMixin.declareNameFromIdentifier [as checkIdentifier] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/lval.ts:700:12)
    at TypeScriptParserMixin.checkIdentifier [as checkLVal] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/lval.ts:615:12)
    at TypeScriptParserMixin.checkLVal [as finishImportSpecifier] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:3000:10)
    at TypeScriptParserMixin.finishImportSpecifier (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:3208:17)
    at TypeScriptParserMixin.parseImportSpecifier (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/plugins/typescript/index.ts:4024:20)
    at TypeScriptParserMixin.parseImportSpecifier [as parseNamedImportSpecifiers] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:3167:36)
    at TypeScriptParserMixin.parseNamedImportSpecifiers (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:2946:39)
    at TypeScriptParserMixin.parseImport (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/plugins/typescript/index.ts:2702:32)
    at TypeScriptParserMixin.parseImport (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:571:25)
    at TypeScriptParserMixin.parseStatementContent (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/plugins/typescript/index.ts:2857:20)
    at TypeScriptParserMixin.parseStatementContent [as parseStatementLike] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:416:17)
    at TypeScriptParserMixin.parseStatementLike [as parseModuleItem] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:353:17)
    at TypeScriptParserMixin.parseModuleItem [as parseBlockOrModuleBlockBody] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:1362:16)
    at TypeScriptParserMixin.parseBlockOrModuleBlockBody [as parseBlockBody] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:1336:10)
    at TypeScriptParserMixin.parseBlockBody [as parseProgram] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:226:10)
    at TypeScriptParserMixin.parseProgram [as parseTopLevel] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/statement.ts:208:25)
    at TypeScriptParserMixin.parseTopLevel (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/parser/index.ts:45:10)
    at TypeScriptParserMixin.parse (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/plugins/typescript/index.ts:3974:20)
    at parse (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/parser/src/index.ts:67:38)
    at parser (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/core/src/parser/index.ts:28:19)
    at parser.next (<anonymous>)
    at normalizeFile (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/core/src/transformation/normalize-file.ts:51:24)
    at normalizeFile.next (<anonymous>)
    at run (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/core/src/transformation/index.ts:38:36)
    at run.next (<anonymous>)
    at transform (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/core/src/transform.ts:29:20)
    at transform.next (<anonymous>)
    at evaluateSync (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/gensync/index.js:251:28)
    at sync (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/gensync/index.js:89:14)
    at fn (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/core/src/errors/rewrite-stack-trace.ts:97:14)
    at transformSync (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/@babel/core/src/transform.ts:66:52)
    at Object.process (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f484cd9f26dcc6f4/elastic/kibana-on-merge/kibana/node_modules/babel-j
[report_failure] output truncated to 8192 characters

First failure: CI Build - main

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Aug 7, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Aug 7, 2023
@kibanamachine kibanamachine added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Aug 7, 2023
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Aug 7, 2023
@afharo
Copy link
Member

afharo commented Aug 24, 2023

Caused by the same reason as #163273. Closing.

@afharo afharo closed this as completed Aug 24, 2023
@kibanamachine kibanamachine reopened this Sep 29, 2023
@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-on-merge - main

gsoldevila added a commit to gsoldevila/kibana that referenced this issue Oct 17, 2024
…6641)

## Summary

Addresses elastic#167676
Addresses elastic#158318
Addresses elastic#163254
Addresses elastic#163255

#### Fix for `multiple_es_nodes.test.ts`
Inspired on elastic#193899

1. Start both nodes of ES 8.17.0 with the affected data-archive on
separate terminals:
1. Node 01: `yarn es snapshot --version=8.17.0 --data-archive
src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip
--base-path .es/node01`
2. Node 02: `yarn es snapshot --version=8.17.0 --data-archive
src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip
--base-path .es/node02`

2. After ES is ready (without starting Kibana), reindex the index
`.kibana_7.13.0_002`
1. Retrieve the settings from the original index via `curl -L
'http://localhost:9200/.kibana_7.13.0_002' -H 'Content-Type:
application/json' -H 'kbn-xsrf: test' -H 'Authorization: Basic
c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d ''`
	2. Create the target index with those settings:
	```shell
curl -L -X PUT 'http://localhost:9200/.kibana_7.13.0_003' -H
'Content-Type: application/json' -H 'kbn-xsrf: test' -H 'Authorization:
Basic c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d '{
      "mappings": {
        "properties": {
          "bar": {
            "properties": {
              "status": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "coreMigrationVersion": {
            "type": "keyword"
          },
          "foo": {
            "properties": {
              "status": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "migrationVersion": {
            "dynamic": "true",
            "properties": {
              "bar": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "foo": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "namespace": {
            "type": "keyword"
          },
          "namespaces": {
            "type": "keyword"
          },
          "originId": {
            "type": "keyword"
          },
          "references": {
            "type": "nested",
            "properties": {
              "id": {
                "type": "keyword"
              },
              "name": {
                "type": "keyword"
              },
              "type": {
                "type": "keyword"
              }
            }
          },
          "type": {
            "type": "keyword"
          },
          "updated_at": {
            "type": "date"
          }
        }
      },
      "settings": {
        "index": {
            "hidden": "true",
            "number_of_shards": "1",
            "number_of_replicas": "0"
        }
      }
    }'
         ```
3. Reindex the content: `curl -L 'http://localhost:9200/_reindex' -H
'Content-Type: application/json' -H 'kbn-xsrf: test' -H 'Authorization:
Basic c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d '{ "source": {
"index": ".kibana_7.13.0_002" }, "dest": { "index": ".kibana_7.13.0_003"
} }'`
    4. Remove the old index and recreate the aliases
    ```shell
curl -L 'http://localhost:9200/_aliases' -H 'Content-Type:
application/json' -H 'kbn-xsrf: test' -H 'Authorization: Basic
c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d '{
  "actions": [
{ "add": { "index": ".kibana_7.13.0_003", "alias": ".kibana_7.13.0_001"
} },
    { "remove_index": {"index": ".kibana_7.13.0_002" } },
{ "add": { "index": ".kibana_7.13.0_003", "alias": ".kibana_7.13.0" } },
    { "add": { "index": ".kibana_7.13.0_003", "alias": ".kibana" } }
  ]
}'
	```
3. Stop both ES nodes.
4. Compress both archives
	```shell
	cd .es/node01/8.17.0
rm -rf data/nodes # we need to remove this dir or it fails to start
again
zip -r
../../../src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip
data -x "*/\.*"
	cd ../../../
	cd .es/node02/8.17.0
rm -rf data/nodes # we need to remove this dir or it fails to start
again
zip -r
../../../src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip
data -x "*/\.*"
	cd ../../../
	```
5. Run the tests to confirm that the issue is fixed: `yarn
test:jest_integration
src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts`

#### Fix for `incompatible_cluster_routing_allocation.test.ts`
Inspired on elastic#193741

```shell
# 1. Start ES 8.17.0 with the affected data-archive
yarn es snapshot --version=8.17.0 --data-archive src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip
# ... after ES has completely started up, stop it.

# 2. Compress the archive
cd .es/8.17.0
zip -r ../../src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip data  -x "*/\.*"
cd ../../

# 3. Run the tests to confirm that the issue is fixed.
yarn test:jest_integration src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts
```

#### Fix for `read_batch_size.test.ts`
Inspired on elastic#193899

```shell
# 1. Start ES 8.17.0 with the affected data-archive
yarn es snapshot --version=8.17.0 --data-archive src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip
# ... after ES has completely started up, stop it.

# 2. Compress the archive
cd .es/8.17.0
zip -r ../../src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip data  -x "*/\.*"
cd ../../

# 3. Run the tests to confirm that the issue is fixed.
yarn test:jest_integration src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts
```

(cherry picked from commit 3d254c2)

# Conflicts:
#	src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts
@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine kibanamachine reopened this Nov 22, 2024
@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@jbudz
Copy link
Member

jbudz commented Nov 25, 2024

Skipped

main: d44f70f

@kibanamachine
Copy link
Contributor Author

@kibanamachine
Copy link
Contributor Author

@kibanamachine
Copy link
Contributor Author

@kibanamachine
Copy link
Contributor Author

@kibanamachine
Copy link
Contributor Author

@kibanamachine
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker failed-es-promotion failed-test A test failure on a tracked branch, potentially flaky-test skipped-test Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v9.0.0
Projects
None yet
Development

No branches or pull requests

7 participants