From d01c61fbbee9a613cbea769f09c260f1d635ddb0 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 16 Oct 2023 11:07:41 +0100 Subject: [PATCH] Better failure logging in testFailsIfRegisterHoldsSpuriousValue (#100888) Relates #99422 --- .../blobstore/testkit/RepositoryAnalysisFailureIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java b/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java index ba132938b238e..251d20dbc4c4f 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java @@ -341,7 +341,9 @@ public BytesReference onCompareAndExchange(BytesRegister register, BytesReferenc analyseRepository(request); assertFalse(sawSpuriousValue.get()); } catch (RepositoryVerificationException e) { - assertTrue(sawSpuriousValue.get()); + if (sawSpuriousValue.get() == false) { + fail(e, "did not see spurious value, so why did the verification fail?"); + } } }