Skip to content

Commit 6dd2e1d

Browse files
Debug statements
1 parent f1b843e commit 6dd2e1d

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

ruby/lib/ci/queue/redis/worker.rb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,29 @@ def load_test_from_entry(test_id)
203203

204204
# Trigger runnable_methods to ensure dynamically generated test methods exist
205205
# (e.g., methods created by Shopify's Flags::ToggleHelper and TestTags)
206-
runnable.runnable_methods if runnable.respond_to?(:runnable_methods)
206+
if runnable.respond_to?(:runnable_methods)
207+
available_methods = runnable.runnable_methods
208+
method_sym = method_name.to_sym
209+
210+
# Verify the method exists after calling runnable_methods
211+
unless available_methods.include?(method_sym)
212+
puts "[ci-queue] ERROR: Method #{method_name} not found in #{class_name}"
213+
puts "[ci-queue] Available methods count: #{available_methods.size}"
214+
puts "[ci-queue] Sample methods: #{available_methods.first(3).join(', ')}"
215+
216+
# Check if there's a similar method with different FLAGS
217+
similar = available_methods.select { |m| m.to_s.start_with?(method_name.split('_FLAGS:').first) }
218+
if similar.any?
219+
puts "[ci-queue] Similar methods found (different FLAGS values?):"
220+
similar.first(3).each { |m| puts "[ci-queue] - #{m}" }
221+
end
222+
223+
raise CI::Queue::LazyLoadError,
224+
"Method #{method_name} not found in #{class_name}. " \
225+
"This may indicate FLAGS values differ between test discovery and execution, " \
226+
"or the test file content has changed."
227+
end
228+
end
207229

208230
Minitest::Queue::SingleExample.new(runnable, method_name, file_path: file_path)
209231
end

0 commit comments

Comments
 (0)