Skip to content

Commit 17b1d4b

Browse files
committed
Remove broken rescue fallback in prefetch
The rescue block claimed to fall back to per-test caching, but those cache calls were removed from the test. A silent catch here would let every subsequent API call hit the network uncached, likely causing rate-limit failures. Let errors propagate so tests fail fast with a clear reason.
1 parent 665a42e commit 17b1d4b

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

test/collections_test_helper.rb

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,21 @@ def prefetch_all_collection_items!
140140
all_repos.uniq!
141141
all_users.uniq!
142142

143-
begin
144-
# Batch repos in chunks to stay within GraphQL query limits
145-
all_repos.each_slice(GRAPHQL_BATCH_SIZE) do |batch|
146-
cache_repos_exist_check!(batch)
147-
end
148-
149-
# Batch users in chunks
150-
all_users.each_slice(GRAPHQL_BATCH_SIZE) do |batch|
151-
cache_users_exist_check!(batch)
152-
end
143+
# Batch repos in chunks to stay within GraphQL query limits
144+
all_repos.each_slice(GRAPHQL_BATCH_SIZE) do |batch|
145+
cache_repos_exist_check!(batch)
146+
end
153147

154-
# Check orgs for users not found
155-
not_found_users = users_not_found_from(all_users)
156-
not_found_users.each_slice(GRAPHQL_BATCH_SIZE) do |batch|
157-
cache_orgs_exist_check!(batch)
158-
end
148+
# Batch users in chunks
149+
all_users.each_slice(GRAPHQL_BATCH_SIZE) do |batch|
150+
cache_users_exist_check!(batch)
151+
end
159152

160-
# Only mark as done after ALL batch calls completed successfully
161-
NewOctokit.global_prefetch_done!
162-
rescue StandardError => error
163-
warn "Global prefetch failed, falling back to per-test caching: #{error.message}"
153+
# Check orgs for users not found
154+
not_found_users = users_not_found_from(all_users)
155+
not_found_users.each_slice(GRAPHQL_BATCH_SIZE) do |batch|
156+
cache_orgs_exist_check!(batch)
164157
end
158+
159+
NewOctokit.global_prefetch_done!
165160
end

0 commit comments

Comments
 (0)