Skip to content

Conversation

ebarajas
Copy link
Contributor

@ebarajas ebarajas commented Sep 24, 2025

  • Updates the existing TestTimeReporter to support exporting test durations out to a file
  • Adds support for ordering strategies, and adds a new strategy that reads in test durations and orders the queue in descending order by duration.

Comment on lines +57 to +60
# Convert test_time_hash to simple format: {"TestClass#method": avg_duration_ms}
timing_data = test_time_hash.transform_values do |durations|
durations.sum.to_f / durations.size # Average duration
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most cases there should just be one duration value, but there are cases where the test is run by multiple workers successfully, so we just take the average in those cases

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting...why would a successful test case get run multiple times in a single build?

Copy link
Contributor Author

@ebarajas ebarajas Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a test goes past the timeout for whatever reason (let's say it hits a really long GC pause), another worker can pick it up, and then both of them end up reporting the success

https://github.com/figma/ci-queue/blob/master/ruby/lib/ci/queue/redis/worker.rb#L208-L231

@ebarajas ebarajas force-pushed the ebarajas/support-ordering-strategies branch from acf1006 to 9a1776f Compare October 1, 2025 15:44
Copy link
Contributor Author

ebarajas commented Oct 1, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ebarajas ebarajas force-pushed the master branch 2 times, most recently from 1f8a4a7 to d50711a Compare October 1, 2025 17:46
@ebarajas ebarajas force-pushed the ebarajas/support-ordering-strategies branch from 9a1776f to 2818672 Compare October 1, 2025 19:40
Comment on lines +57 to +60
# Convert test_time_hash to simple format: {"TestClass#method": avg_duration_ms}
timing_data = test_time_hash.transform_values do |durations|
durations.sum.to_f / durations.size # Average duration
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting...why would a successful test case get run multiple times in a single build?

@ebarajas ebarajas merged commit fcd85c1 into master Oct 2, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants