AI: address issue #483

このコミットが含まれているのは:
Codex Night Worker
2026-11-18 12:28:16 +09:00
コミット f21cd7d671
3個のファイルの変更、60行の追加、2行の削除
+33
ファイルの表示
@@ -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')