From 76ca96702e6c9349b823edd4563a6591322c73c1 Mon Sep 17 00:00:00 2001 From: Fae Charlton Date: Mon, 24 Mar 2025 09:32:04 -0400 Subject: [PATCH] [Flaky test] Disable flaky zookeeper tests (#43381) Disable the flaky test `metricbeat/module/zookeeper/test_zookeeper`, reported in https://github.com/elastic/beats/issues/43385. Also add a message to the failing assertions indicating the actual data the tests failed on, so when a failure does happen we can see what caused it. (cherry picked from commit 9e29bcb1044ce37bf6d13b00784a1fa5f79f0540) --- metricbeat/module/zookeeper/test_zookeeper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/metricbeat/module/zookeeper/test_zookeeper.py b/metricbeat/module/zookeeper/test_zookeeper.py index abfa1a2dc249..5b09910ecc54 100644 --- a/metricbeat/module/zookeeper/test_zookeeper.py +++ b/metricbeat/module/zookeeper/test_zookeeper.py @@ -14,6 +14,7 @@ "approximate_data_size", "num_alive_connections"] +@unittest.skip("flaky test suite: https://github.com/elastic/beats/issues/43385") @metricbeat.parameterized_with_supported_versions class ZooKeeperMntrTest(metricbeat.BaseTest): @@ -37,7 +38,7 @@ def test_output(self): self.assert_no_logged_warnings() output = self.read_output_json() - self.assertEqual(len(output), 1) + self.assertEqual(len(output), 1, f"expected one output result, got: {output}") evt = output[0] self.assertCountEqual(self.de_dot(ZK_FIELDS), evt.keys()) @@ -71,7 +72,7 @@ def test_output(self): self.assert_no_logged_warnings() output = self.read_output_json() - self.assertEqual(len(output), 1) + self.assertEqual(len(output), 1, f"expected one output result, got: {output}") evt = output[0] self.assertCountEqual(self.de_dot(ZK_FIELDS), evt.keys()) @@ -99,7 +100,7 @@ def test_connection(self): self.assert_no_logged_warnings() output = self.read_output_json() - self.assertEqual(len(output), 1) + self.assertEqual(len(output), 1, f"expected one output result, got: {output}") evt = output[0] self.assertCountEqual(self.de_dot(ZK_FIELDS + ["client"]), evt.keys())