Bug #28184
closedforeman-maintain leaves fio test-files after running disk-benchmark
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1762302
Description of problem:
After running foreman-maintain, /var/lib/pulp/job1.0.0 is still on the disk. This file was created by the fio disk-benchmark.
fio --name=job1 --rw=read --size=1g --output-format=json --directory=/var/lib/pulp --direct=1
- ls
lh /var/lib/pulp/job1.0.0. 1 root root 1.0G Oct 16 12:51 /var/lib/pulp/job1.0.0
-rw-r--r-
- rpm -qa |grep maintain
rubygem-foreman_maintain-0.3.5-1.el7sat.noarch
satellite-maintain-0.0.1-1.el7sat.noarch
How reproducible:
Always
Steps to Reproduce:
1. run "foreman-maintain health check --label disk-performance"
2. see "/var/lib/pulp/job1.0.0" created, but never removed
3.
Actual results:
Leftovers from those benchmark tests.
Expected results:
Leftovers removed after benchmark has been run
Additional info:
/usr/share/gems/gems/foreman_maintain-0.3.5/lib/foreman_maintain/utils/disk/io_device.rb should probably add a file-removal after fio finished.
28 def fio
29 cmd = "fio --name=job1 --rw=read --size=1g --output-format=json\
30 --directory=#{dir} --direct=1"
31 stdout = execute(cmd)
32 output = JSON.parse(stdout)
33 @fio ||= output['jobs'].first['read']['bw'].to_i
34 endprobably here??
Additional, I see that /usr/share/gems/gems/foreman_maintain-0.3.5/definitions/checks/disk/performance.rb should test pulp, mongo and pgsql directories for speed, I only saw pulp being tested.
17 DEFAULT_DIRS = ['/var/lib/pulp', '/var/lib/mongodb', '/var/lib/pgsql'].freeze
Updated by Andreas Bleischwitz about 5 years ago
- Difficulty set to trivial
Adding "--unlink=true" to the command line should already do the trick.
man fio:
unlink=bool
Unlink the job files when done. Not the default, as repeated runs of that job would then waste time recreating the file set again and again. Default: false.
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_maintain/pull/303 added
Updated by Kavita Gaikwad about 5 years ago
- Assignee changed from Anurag Patel to Kavita Gaikwad
Updated by Kavita Gaikwad almost 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_maintain|35451244417081588015aa676f109e5d950d8240.