Flaky Spec Fixes: Dont Assume No Elasticsearch Data, Refresh before delete_by_query (#8354)
This commit is contained in:
parent
1bf5ea42f0
commit
9e3b6a090b
2 changed files with 2 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ module ElasticsearchHelpers
|
|||
end
|
||||
|
||||
def clear_elasticsearch_data(search_class)
|
||||
search_class.refresh_index
|
||||
Search::Client.delete_by_query(
|
||||
index: search_class::INDEX_ALIAS, body: { query: { match_all: {} } },
|
||||
)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ RSpec.describe Metrics::RecordDataCountsWorker, type: :worker do
|
|||
|
||||
expect(
|
||||
DatadogStatsClient,
|
||||
).to have_received(:gauge).with("elasticsearch.document_count", 0, tags: Array).at_least(1)
|
||||
).to have_received(:gauge).with("elasticsearch.document_count", Integer, tags: Array).at_least(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue