Skip to content

Commit c5631c1

Browse files
committed
Fix timing issue in spec
1 parent 9d45222 commit c5631c1

5 files changed

+140
-60
lines changed

spec/fixtures/cassettes/vector_store_file_batches_list.yml

Lines changed: 84 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/vector_store_file_batches_list_file_setup.yml

Lines changed: 18 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/vector_store_file_batches_list_vector_store_file_batch_setup.yml

Lines changed: 17 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/vector_store_file_batches_list_vector_store_setup.yml

Lines changed: 15 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/openai/client/vector_store_file_batches_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
let(:response) do
3030
OpenAI::Client.new.vector_store_file_batches.list(vector_store_id: vector_store_id,
3131
id: file_batch_id)
32+
rescue Faraday::ServerError => e
33+
# 500 error is caused by the file batch not being processed yet, so we handle it here.
34+
raise unless e.response[:status] == 500
35+
36+
# Wait for the file batch to be processed.
37+
sleep 0.5 && retry
3238
end
3339

3440
before { file_batch_id }

0 commit comments

Comments
 (0)