Skip to content

Commit

Permalink
Revert "Fix SourceOnlySnapshotIT (#53462)" (#53671)
Browse files Browse the repository at this point in the history
This reverts commit 7ba9cf5.
  • Loading branch information
DaveCTurner committed Mar 17, 2020
1 parent f10c245 commit 4bd58b8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public void testSnapshotAndRestore() throws Exception {
});
assertTrue(e.toString().contains("_source only indices can't be searched or filtered"));

// can-match phase pre-filters access to non-existing field
assertEquals(0,
client().prepareSearch(sourceIdx).setQuery(QueryBuilders.termQuery("field1", "bar")).get().getHits().getTotalHits().value);
e = expectThrows(SearchPhaseExecutionException.class, () ->
client().prepareSearch(sourceIdx).setQuery(QueryBuilders.termQuery("field1", "bar")).get());
assertTrue(e.toString().contains("_source only indices can't be searched or filtered"));
// make sure deletes do not work
String idToDelete = "" + randomIntBetween(0, builders.length);
expectThrows(ClusterBlockException.class, () -> client().prepareDelete(sourceIdx, "_doc", idToDelete)
Expand All @@ -131,9 +131,9 @@ public void testSnapshotAndRestoreWithNested() throws Exception {
SearchPhaseExecutionException e = expectThrows(SearchPhaseExecutionException.class, () ->
client().prepareSearch(sourceIdx).setQuery(QueryBuilders.idsQuery().addIds("" + randomIntBetween(0, builders.length))).get());
assertTrue(e.toString().contains("_source only indices can't be searched or filtered"));
// can-match phase pre-filters access to non-existing field
assertEquals(0,
client().prepareSearch(sourceIdx).setQuery(QueryBuilders.termQuery("field1", "bar")).get().getHits().getTotalHits().value);
e = expectThrows(SearchPhaseExecutionException.class, () ->
client().prepareSearch(sourceIdx).setQuery(QueryBuilders.termQuery("field1", "bar")).get());
assertTrue(e.toString().contains("_source only indices can't be searched or filtered"));
// make sure deletes do not work
String idToDelete = "" + randomIntBetween(0, builders.length);
expectThrows(ClusterBlockException.class, () -> client().prepareDelete(sourceIdx, "_doc", idToDelete)
Expand Down

0 comments on commit 4bd58b8

Please sign in to comment.