test: fix stale Doris SQL-shape and flaky OSS bucket assertions

Two pre-existing test failures on main, unrelated to any feature change:

- Doris VectorRetrieve/KeywordsRetrieve inline LIMIT as a literal (Doris
  does not support placeholders for LIMIT/OFFSET), but the SQL-shape tests
  still expected `LIMIT ?` with TopK as a bound arg. Match the literal
  LIMIT and drop the extra argument.
- TestOssEnsureBucket_CreateFails used the bucket name "test-bucket",
  which already exists globally on OSS, so IsBucketExist short-circuited
  and the create path never ran. Use a non-existent bucket name so the
  create-with-invalid-credentials path is actually exercised.
This commit is contained in:
wizardchen
2026-06-29 17:43:38 +08:00
committed by lyingbug
parent af432c5e06
commit 40f217c228
2 changed files with 14 additions and 7 deletions
@@ -192,8 +192,11 @@ func TestOssEnsureBucket_CreateFails(t *testing.T) {
t.Fatalf("newOSSClient() error: %v", err)
}
// Should fail with invalid credentials
err = ossEnsureBucket(client, "test-bucket")
// Use a bucket that does not exist so IsBucketExist returns false and the
// create path is exercised; with invalid credentials PutBucket then fails.
// A common name like "test-bucket" already exists globally on OSS, which
// would short-circuit at IsBucketExist and make this assertion flaky.
err = ossEnsureBucket(client, "weknora-nonexistent-bucket-create-fails-12345")
if err == nil {
t.Error("ossEnsureBucket with invalid credentials should return an error")
}