Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Cable integration test should soft fail on exit 3 #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zzak
Copy link
Member

@zzak zzak commented Sep 13, 2024

This is to support rails/rails#51990.

Inside the actioncable test:integration job, we capture the output and look for The environment you requested was unavailable which happens far too often: https://buildkite.com/rails/rails/builds/111313#0191e945-faef-4d92-8f8a-74dbd1d397db

If we capture that output, the job will exit 3.

In this PR, we've added a retry policy for 1 extra retry (2 total attempts) and to mark the job as soft_fail if the exit status 3 persists.

This should cut down on flaky builds due to actioncable:integration step failing.

I've tested the behavior locally in various scenarios.

Comment on lines +109 to +110
[retry_on].flatten.compact.each do |retry_args|
automatic_retry_on(**retry_args)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is sugar to support passing a hash or array of hashes, as supported by the automatic retry attributes.

end
automatic_retry_on(**build_context.automatic_retry_on)
Copy link
Member Author

Choose a reason for hiding this comment

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

Before we would either set the given policy OR the default, now we always set both. There is some duplication in the rails-ci pipeline where we can remove the old retry policy commands now.

Comment on lines +116 to +119
if soft_fail.is_a?(TrueClass) || build_context.ruby.soft_fail?
soft_fail true
else
soft_fail([soft_fail].flatten.compact) if soft_fail
Copy link
Member Author

Choose a reason for hiding this comment

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

Since soft_fail can be either a boolean, or an array of hashes. I still want the sugar to support both arrays or hashes, AND we have to consider if the Ruby version is soft failed.

I haven't tested what the result is if you for example, pass an empty array, and wanted to limit the amount of change here -- but there is probably a nicer way to write this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant