Commit 50dce215 authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-group-audit-logs-spec-fix' into 'master'

Fix group audit log spec operator

Closes #197972

See merge request gitlab-org/gitlab!31650
parents ac398dfa a2148176
...@@ -141,20 +141,14 @@ module QA ...@@ -141,20 +141,14 @@ module QA
def get_audit_event_count(group) def get_audit_event_count(group)
response = get Runtime::API::Request.new(api_client, "/groups/#{group.id}/audit_events").url response = get Runtime::API::Request.new(api_client, "/groups/#{group.id}/audit_events").url
puts response
parse_body(response).length parse_body(response).length
end end
def wait_for_audit_events(expected_events, group) def wait_for_audit_events(expected_events, group)
new_event_count = @event_count + expected_events.length new_event_count = @event_count + expected_events.length
puts "****************"
puts "New event count #{new_event_count}"
Support::Retrier.retry_until(max_duration: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME, sleep_interval: 1) do Support::Retrier.retry_until(max_duration: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME, sleep_interval: 1) do
current_event_count = get_audit_event_count(group) get_audit_event_count(group) >= new_event_count
puts "Current event count #{current_event_count}"
current_event_count == new_event_count
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment