Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/bucket_manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def test_update_bucket_history_retention
s.history_retention_duration = 600
end,
)

env.consistency.wait_until_bucket_satisfies_predicate(bucket_name) do |c|
c["historyRetentionCollectionDefault"] == false
end

res = @bucket_manager.get_bucket(bucket_name)

refute res.history_retention_collection_default
Expand Down
12 changes: 10 additions & 2 deletions test/utils/consistency_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def fetch_hosts(management_endpoint, timeout: DEFAULT_TIMEOUT_SECS)
node_services = JSON.parse(node_services_resp.body)

config["nodes"].zip(node_services["nodesExt"]).each do |node, node_ext|
@management_hosts << node["configuredHostname"]
host = node["configuredHostname"].split(":")[0]
@management_hosts << node["hostname"]
host = node["hostname"].split(":")[0]
Comment thread
DemetrisChr marked this conversation as resolved.
@query_hosts << "#{host}:#{node_ext['services']['n1ql']}" if node_ext["services"].key?("n1ql")
end
break
Expand All @@ -88,6 +88,14 @@ def wait_until_bucket_dropped(name, timeout: DEFAULT_TIMEOUT_SECS)
end
end

def wait_until_bucket_satisfies_predicate(bucket_name, timeout: DEFAULT_TIMEOUT_SECS, &blk)
wait_until(timeout,
"Bucket `#{bucket_name}` does not satisfy the predicate at " \
"#{blk.source_location.join(':')} in all nodes") do
resource_satisfies_predicate("pools/default/buckets/#{bucket_name}", &blk)
end
end

def wait_until_scope_present(bucket_name, scope_name, timeout: DEFAULT_TIMEOUT_SECS)
wait_until(timeout, "Scope `#{scope_name}` in bucket `#{bucket_name}` is not present in all nodes") do
resource_satisfies_predicate("pools/default/buckets/#{bucket_name}/scopes") do |resp|
Expand Down
Loading