Skip to content

Commit f7bfeaf

Browse files
committed
Clean up unused test infrastructure
1 parent a55f871 commit f7bfeaf

File tree

8 files changed

+28
-364
lines changed

8 files changed

+28
-364
lines changed

.github/workflows/acceptance-tests.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,6 @@ website/node_modules
164164
*.iml
165165
website/vendor
166166
tfplan
167+
168+
# Examples directory (local testing only)
169+
examples/

internal/provider/resource_openai_vector_store_file.go

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,35 @@ func resourceOpenAIVectorStoreFileCreate(ctx context.Context, d *schema.Resource
263263
}
264264
}
265265

266-
// Wait for the file to be available in the vector store with retry logic
266+
// Wait for the file to be available in the vector store with retry logic.
267+
// This addresses eventual consistency issues where the OpenAI API returns
268+
// "No file found" errors immediately after file creation (issue #35).
267269
return resourceOpenAIVectorStoreFileReadWithRetry(ctx, d, m, 5)
268270
}
269271

270272
// resourceOpenAIVectorStoreFileReadWithRetry attempts to read the vector store file with retry logic
271-
// to handle eventual consistency issues with the OpenAI API
273+
// to handle eventual consistency issues with the OpenAI API.
274+
//
275+
// When a vector store file is created, the OpenAI API may temporarily return "file not found"
276+
// errors due to eventual consistency delays in their backend. This is especially common when
277+
// creating multiple files simultaneously.
278+
//
279+
// Retry Behavior:
280+
// - Retries up to maxRetries times (default: 5)
281+
// - Uses exponential backoff: 1s, 2s, 4s, 8s, 16s (max ~31s total)
282+
// - Only retries on "not found" errors (case-insensitive)
283+
// - Returns immediately on other errors (unauthorized, rate limit, etc.)
284+
// - Logs retry attempts for debugging
285+
//
286+
// Parameters:
287+
// - ctx: Context for logging
288+
// - d: Resource data
289+
// - m: Provider metadata containing OpenAI client
290+
// - maxRetries: Maximum number of read attempts (must be >= 1)
291+
//
292+
// Returns:
293+
// - nil diagnostics on success
294+
// - diagnostics with error details if all retries are exhausted or non-retriable error occurs
272295
func resourceOpenAIVectorStoreFileReadWithRetry(ctx context.Context, d *schema.ResourceData, m interface{}, maxRetries int) diag.Diagnostics {
273296
var lastErr diag.Diagnostics
274297

internal/provider/resource_openai_vector_store_file_test.go

Lines changed: 0 additions & 240 deletions
This file was deleted.

testdata/sample.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

testdata/sample1.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)