Skip to content

[Tests] Don't use concurrent search in scripted field type tests#90712

Merged
cbuescher merged 1 commit intoelastic:mainfrom
cbuescher:fix-90497
Oct 6, 2022
Merged

[Tests] Don't use concurrent search in scripted field type tests#90712
cbuescher merged 1 commit intoelastic:mainfrom
cbuescher:fix-90497

Conversation

@cbuescher
Copy link
Copy Markdown
Member

The field types in these tests use scripts which accesses _source via SourceLookup, which in turn isn't thread-safe. Since ES doesn't use concurent search on the Lucene level it is safe to disable the otherwise randomized use of multiple threads in searchers. This change adds a new helper method for that in AbstractScriptFieldTypeTestCase which all of the sub-test use.

Closes #90497

@cbuescher cbuescher added >test Issues or PRs that are addressing/adding tests :Search Foundations/Mapping Index mappings, including merging and defining field types v8.5.1 v8.6.0 labels Oct 6, 2022
@cbuescher cbuescher requested a review from romseygeek October 6, 2022 12:12
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (Team:Search)

@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Oct 6, 2022
The field types in these tests use scripts which accesses _source via
SourceLookup, which in turn isn't thread-safe. Since ES doesn't use concurent
search on the Lucene level it is safe to disable the otherwise randomized use of
multiple threads in searchers. This change adds a new helper method for that in
AbstractScriptFieldTypeTestCase which all of the sub-test use.

Closes elastic#90497
Copy link
Copy Markdown
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
8.5

cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Oct 6, 2022
…stic#90712)

The field types in these tests use scripts which accesses _source via
SourceLookup, which in turn isn't thread-safe. Since ES doesn't use concurent
search on the Lucene level it is safe to disable the otherwise randomized use of
multiple threads in searchers. This change adds a new helper method for that in
AbstractScriptFieldTypeTestCase which all of the sub-test use.

Closes elastic#90497
elasticsearchmachine pushed a commit that referenced this pull request Oct 6, 2022
) (#90716)

The field types in these tests use scripts which accesses _source via
SourceLookup, which in turn isn't thread-safe. Since ES doesn't use concurent
search on the Lucene level it is safe to disable the otherwise randomized use of
multiple threads in searchers. This change adds a new helper method for that in
AbstractScriptFieldTypeTestCase which all of the sub-test use.

Closes #90497
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Oct 10, 2022
* main: (150 commits)
  Remove ToXContent interface from ChunkedToXContent (elastic#90409)
  Remove extra SearchService constructor (elastic#90733)
  Update min version for the diagnosis yaml test (elastic#90731)
  Use the AggTestConfig object in testCase (elastic#90699)
  [DOCS] Add links to clear trained model deployment cache API (elastic#90727)
  Assert wildcards are not expanded as specified by request options  (elastic#90641)
  [TEST] Fix exit snapshot restore exit condition (elastic#90696)
  [TEST] Change to atomic file contents save (elastic#90695)
  Update forbiddenapis to 3.4 (elastic#90624)
  [Tests] Don't use concurrent search in scripted field type tests (elastic#90712)
  [ML] Move scaling is possible check for starting trained model (elastic#90706)
  Add new base test case for chunked xcontent types  (elastic#90707)
  Fix testRedNoBlockedIndicesAndRedAllRoleNodes (elastic#90671)
  Fix nullpointer in docs test setup (elastic#90660)
  Don't produce build logs artifact when in a composite build
  Fixing a race condition in EnrichCoordinatorProxyAction that can leave an item stuck in its queue (elastic#90688)
  docs: update fleet/agent pipeline docs (elastic#90659)
  [HealthAPI] Use plural consistently in resource types (elastic#90682)
  [Testing] Enable bwc and fix sorting for 500_date_range (elastic#90681)
  Add profiling and documentation for dfs phase (elastic#90536)
  ...

# Conflicts:
#	x-pack/plugin/mapper-aggregate-metric/src/test/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapperTests.java
@csoulios csoulios added v8.5.0 and removed v8.5.1 labels Nov 8, 2022
romseygeek added a commit that referenced this pull request Apr 17, 2023
This commit reverts #90712, which disabled concurrency on runtime
field scripts. Since #95082 these scripts should be thread-safe, and so
we can use the standard test searcher methods which may randomly
add multi-threaded search.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team >test Issues or PRs that are addressing/adding tests v8.5.0 v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] KeywordScriptFieldTypeTests testTermsQuery failing

4 participants