AI: address issue #483
このコミットが含まれているのは:
@@ -210,6 +210,39 @@ RSpec.describe 'Static Mirror API', type: :request do
|
||||
lock&.close
|
||||
end
|
||||
|
||||
it 'preserves expiry between reading the queue and starting generation' do
|
||||
id = create_job
|
||||
worker = StaticMirrorJob.new
|
||||
allow(worker).to receive(:generate).and_wrap_original do |original, *arguments|
|
||||
travel 80.seconds do
|
||||
get "/static_mirror/jobs/#{ id }"
|
||||
expect(json).to include('status' => 'failed', 'error' => 'worker_stopped')
|
||||
original.call(*arguments)
|
||||
end
|
||||
end
|
||||
worker.perform(id)
|
||||
expect(StaticMirrorJob.state).to include('status' => 'failed', 'error' => 'worker_stopped')
|
||||
end
|
||||
|
||||
it 'rejects late progress and completion after a running job expires' do
|
||||
id = create_job
|
||||
mirror = instance_double(StaticMirror, data_at: Time.current.utc.iso8601(6), authority: { })
|
||||
allow(StaticMirror).to receive(:new).and_return(mirror)
|
||||
allow(mirror).to receive(:export) do |&progress|
|
||||
travel 80.seconds do
|
||||
get "/static_mirror/jobs/#{ id }"
|
||||
expect(json).to include('status' => 'failed', 'error' => 'worker_stopped')
|
||||
progress.call(1, 1)
|
||||
end
|
||||
'late archive bytes'
|
||||
end
|
||||
StaticMirrorJob.perform_now(id)
|
||||
expect(StaticMirrorJob.state).to include('status' => 'failed', 'error' => 'worker_stopped',
|
||||
'processed' => 0, 'total' => nil)
|
||||
get "/static_mirror/files/#{ id }"
|
||||
expect(response).to have_http_status(:not_found)
|
||||
end
|
||||
|
||||
it 'reports bounded-generation failures without returning internal exception messages' do
|
||||
id = create_job
|
||||
allow(StaticMirror).to receive(:new).and_raise(StaticMirror::TooLarge, 'private details')
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする