Commit 175d7b60 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '211950-impossible-to-remove-orphan-artifact-files' into 'master'

Resolve "Impossible to remove orphan artifact files"

Closes #211950

See merge request gitlab-org/gitlab!28023
parents 3da64134 e42ca1fb
---
title: Fix invalid class option for ionice
merge_request: 28023
author:
type: fixed
......@@ -102,7 +102,7 @@ module Gitlab
if ionice
raise ArgumentError, 'Invalid niceness' unless VALID_NICENESS_LEVELS.include?(niceness)
cmd.unshift(*%W[#{ionice} --class #{niceness}])
cmd.unshift(*%W[#{ionice} -c #{niceness}])
end
log_info("find command: '#{cmd.join(' ')}'")
......
......@@ -28,6 +28,12 @@ describe Gitlab::Cleanup::OrphanJobArtifactFiles do
expect { cleanup.run! }.to raise_error('Invalid niceness')
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
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