-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
CI: test_plugin_systemd.rb - fixups for intermittent retries #3594
Conversation
@@ -137,10 +137,7 @@ def self.notify(state, unset_env=false) | |||
ENV.delete("NOTIFY_SOCKET") if unset_env | |||
|
|||
begin | |||
Addrinfo.unix(sock, :DGRAM).connect do |s| | |||
s.close_on_exec = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we remove this line because (from https://docs.ruby-lang.org/en/3.3/IO.html#method-i-close_on_exec-3D)
Ruby sets close-on-exec flags of all file descriptors by default since Ruby 2.0.0. So you don’t need to set by yourself.
test/test_plugin_systemd.rb
Outdated
@socket = Socket.new(:UNIX, :DGRAM, 0) | ||
socket_ai = Addrinfo.unix(@sockaddr) | ||
@socket.bind Addrinfo.unix(@sockaddr) | ||
@env = {"NOTIFY_SOCKET" => @sockaddr } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@env = {"NOTIFY_SOCKET" => @sockaddr } | |
@env = { "NOTIFY_SOCKET" => @sockaddr } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you suggested, and rebased.
Interesting, much of Ruby's docs have no spaces with hashes, but much of the Rails docs use spaces...
81c92cc
to
872f84b
Compare
* CI: test_plugin_systemd.rb - update systemd NOTIFY_SOCKET creation * CI: test_plugin_systemd.rb - refactor assert_message * sd_notify.rb - small refactor, update for new Rubies
Description
The tests in this file fail and/or retry intermittently. The changes involve code that parses the notify socket. On GHA CI, there are status messages interlaced with other messages. These are due to delays common on GHA, but not reproducible locally.
It seems to help...
Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.