Skip to content

Commit

Permalink
Fix Elasticsearch index behavior in case of missing settings (#42426)
Browse files Browse the repository at this point in the history
* Unskip test

* Bold move: assumes we can drop test coverage for unsupported versions

* Added test case: index with no cluster state entry or settings

* Added comment about "race situation"

* Logged index settings error as debug, fixed test case

* Handling for multi version tests

* Added changelog entry

---------

Co-authored-by: Valentin Crettaz <valentin.crettaz@consulthys.com>
Co-authored-by: Valentin Crettaz <valentin.crettaz@elastic.co>
  • Loading branch information
3 people authored Jan 29, 2025
1 parent b5f726b commit 074a201
Show file tree
Hide file tree
Showing 31 changed files with 171,281 additions and 14,549 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Fix bug where metricbeat unintentionally triggers Windows ASR. {pull}42177[42177]
- Remove `hostname` field from zookeeper's `mntr` data stream. {pull}41887[41887]
- Continue collecting metrics even if the Cisco Meraki `getDeviceLicenses` operation fails. {pull}42397[42397]
- Fixed errors in the `elasticsearch.index` metricset when index settings are missing. {issue}42424[42424] {pull}42426[42426]

*Osquerybeat*

Expand Down
2 changes: 1 addition & 1 deletion filebeat/tests/system/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def test_restart_recursive_glob(self):
filebeat = self.start_beat()

self.wait_until(
lambda: self.output_has_message("entry2", output_file="output/filebeat-"+self.today+"-1.ndjson"),
lambda: self.output_has_message("entry2", output_file="output/filebeat-" + self.today + "-1.ndjson"),
max_timeout=10,
name="output contains 'entry2'")

Expand Down
2 changes: 1 addition & 1 deletion libbeat/tests/system/beat/common_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_export_config(self):
class TestDashboardMixin:

@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
@pytest.mark.timeout(5*60, func_only=True)
@pytest.mark.timeout(5 * 60, func_only=True)
def test_dashboards(self):
"""
Test that the dashboards can be loaded with `setup --dashboards`
Expand Down
2 changes: 1 addition & 1 deletion libbeat/tests/system/idxmgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def delete_index_and_alias(self, index=""):
index = self._index

for pattern in self.patterns:
index_with_pattern = index+"-"+pattern
index_with_pattern = index + "-" + pattern
try:
self._client.indices.delete(index_with_pattern)
self._client.indices.delete_alias(index, index_with_pattern)
Expand Down
2 changes: 1 addition & 1 deletion libbeat/tests/system/test_cmd_setup_index_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_setup_template_disabled(self):
"-E", "setup.template.enabled=false"])

assert exit_code == 0
self.idxmgmt.assert_index_template_not_loaded(self.data_stream+"ba")
self.idxmgmt.assert_index_template_not_loaded(self.data_stream + "ba")
self.idxmgmt.assert_policy_created(self.policy_name)

@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
Expand Down
Loading

0 comments on commit 074a201

Please sign in to comment.