Clean up after unit tests - #4050
Merged
Merged
Conversation
@socket_manager_server -> @socket_manager_path Signed-off-by: abetomo <abe@enzou.tokyo>
Files created in `/tmp` are deleted. Signed-off-by: abetomo <abe@enzou.tokyo>
daipom
self-requested a review
February 10, 2023 06:03
daipom
reviewed
Feb 10, 2023
daipom
reviewed
Feb 10, 2023
ashie
reviewed
Feb 13, 2023
Backup files are generated in `/tmp` and remain there. Set `root_dir` to generate backup files in the specified directory. Signed-off-by: abetomo <abe@enzou.tokyo>
abetomo
force-pushed
the
clean-up-after-unit-tests
branch
from
February 13, 2023 13:08
0e647ed to
a6b02da
Compare
Contributor
Author
|
With the committed changes and the following changes, all files were cleaned. diff --git a/test/command/test_fluentd.rb b/test/command/test_fluentd.rb
index 461e19ef..9d62cd40 100644
--- a/test/command/test_fluentd.rb
+++ b/test/command/test_fluentd.rb
@@ -85,12 +85,12 @@ class TestFluentdCommand < ::Test::Unit::TestCase
yield pid, io
# p(here: "execute command", pid: pid, worker_pids: @worker_pids)
ensure
- Process.kill(:KILL, pid) rescue nil
+ Process.kill(:TERM, pid) rescue nil
if @supervisor_pid
- Process.kill(:KILL, @supervisor_pid) rescue nil
+ Process.kill(:TERM, @supervisor_pid) rescue nil
end
@worker_pids.each do |cpid|
- Process.kill(:KILL, cpid) rescue nil
+ Process.kill(:TERM, cpid) rescue nil
end
# p(here: "execute command", pid: pid, exist: process_exist?(pid), worker_pids: @worker_pids, exists: @worker_pids.map{|i| process_exist?(i) })
Timeout.timeout(10){ sleep 0.1 while process_exist?(pid) }When you exit with SIGTERM, the shutdown process runs and the files are deleted. |
`instance_shutdown` in `ensure` block. Signed-off-by: abetomo <abe@enzou.tokyo>
Member
|
How about trying |
Contributor
Author
|
@ashie Thanks! |
With SIGTERM, the shutdown process runs. `SERVERENGINE_SOCKETMANAGER_*` etc. will be removed in the shutdown process. When it cannot be terminated by SIGTERM, it is terminated by SIGKILL. Signed-off-by: abetomo <abe@enzou.tokyo>
abetomo
marked this pull request as ready for review
February 16, 2023 14:51
Member
|
Retrying some unstable tests not concerned with this PR... |
daipom
approved these changes
Feb 17, 2023
daipom
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks for the fix!
Member
|
Thanks! |
Contributor
Author
|
Thanks for your review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue(s) this PR fixes:
Fixes #4048
What this PR does / why we need it:
After unit testing, clean up in /tmp.
(If you cannot terminate with SIGTERM and terminate with SIGKILL, some files cannot be cleaned up. #4050 (comment) #4050 (comment))
Docs Changes:
None
Release Note:
None