Commit e42ca1fb authored by Dan Davison's avatar Dan Davison Committed by Ash McKenzie

Resolve "Impossible to remove orphan artifact files"

parent 713d19c2
---
title: Fix invalid class option for ionice
merge_request: 28023
author:
type: fixed
...@@ -102,7 +102,7 @@ module Gitlab ...@@ -102,7 +102,7 @@ module Gitlab
if ionice if ionice
raise ArgumentError, 'Invalid niceness' unless VALID_NICENESS_LEVELS.include?(niceness) raise ArgumentError, 'Invalid niceness' unless VALID_NICENESS_LEVELS.include?(niceness)
cmd.unshift(*%W[#{ionice} --class #{niceness}]) cmd.unshift(*%W[#{ionice} -c #{niceness}])
end end
log_info("find command: '#{cmd.join(' ')}'") log_info("find command: '#{cmd.join(' ')}'")
......
...@@ -28,6 +28,12 @@ describe Gitlab::Cleanup::OrphanJobArtifactFiles do ...@@ -28,6 +28,12 @@ describe Gitlab::Cleanup::OrphanJobArtifactFiles do
expect { cleanup.run! }.to raise_error('Invalid niceness') expect { cleanup.run! }.to raise_error('Invalid niceness')
end end
it 'passes correct arguments to ionice' do
allow(Gitlab::Utils).to receive(:which).with('ionice').and_return('/fake/ionice')
expect(Open3).to receive(:popen3).with('/fake/ionice', '-c', any_args)
cleanup.run!
end
it 'finds artifacts on disk' do it 'finds artifacts on disk' do
artifact = create(:ci_job_artifact, :archive) artifact = create(:ci_job_artifact, :archive)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment