Commit 88c6f9a8 authored by Stan Hu's avatar Stan Hu

Merge branch 'sh-fix-cluster-agents-spec' into 'master'

Fix flaky test in ee/spec/requests/api/graphql/project/cluster_agents_spec.rb

See merge request gitlab-org/gitlab!59934
parents a1cd38b9 64eec48d
......@@ -50,8 +50,8 @@ RSpec.describe 'Project.cluster_agents' do
end
context 'selecting tokens' do
let_it_be(:token_1) { create(:cluster_agent_token, agent: agents.first) }
let_it_be(:token_2) { create(:cluster_agent_token, agent: agents.second) }
let_it_be(:token_1) { create(:cluster_agent_token, agent: agents.second) }
let_it_be(:token_2) { create(:cluster_agent_token, agent: agents.second, last_used_at: 3.days.ago) }
let_it_be(:token_3) { create(:cluster_agent_token, agent: agents.second, last_used_at: 2.days.ago) }
let(:cluster_agents_fields) { [:id, query_nodes(:tokens, of: 'ClusterAgentToken')] }
......@@ -62,9 +62,9 @@ RSpec.describe 'Project.cluster_agents' do
tokens = graphql_data_at(:project, :cluster_agents, :nodes, :tokens, :nodes)
expect(tokens).to match([
a_hash_including('id' => global_id_of(token_1)),
a_hash_including('id' => global_id_of(token_3)),
a_hash_including('id' => global_id_of(token_2))
a_hash_including('id' => global_id_of(token_2)),
a_hash_including('id' => global_id_of(token_1))
])
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