fix tests

This commit is contained in:
Anton Popov 2022-11-29 17:33:35 +00:00
parent 486da48ae7
commit 2a1fd48e91
4 changed files with 12 additions and 4 deletions

View File

@ -883,7 +883,10 @@ namespace S3
}
else if (throw_on_error)
{
throw DB::Exception(outcome.GetError().GetMessage(), ErrorCodes::S3_ERROR);
const auto & error = outcome.GetError();
throw DB::Exception(ErrorCodes::S3_ERROR,
"Failed to HEAD object: {}. HTTP response code: {}",
error.GetMessage(), static_cast<size_t>(error.GetResponseCode()));
}
return {};
}

View File

@ -228,7 +228,10 @@ private:
}
if (temp_buffer.empty())
{
buffer_iter = buffer.begin();
return;
}
if (!filter_ast.has_value())
createFilterAST(temp_buffer.front().key);

View File

@ -1,6 +1,6 @@
import sys
from bottle import abort, route, run, request, response
from bottle import route, run, request, response
@route("/redirected/<_path:path>")
@ -15,7 +15,8 @@ def server(_bucket, _path):
for name in request.headers:
if name == "Authorization" and request.headers[name] == "Bearer TOKEN":
result = "1, 2, 3"
response.headers["Content-Length"] = len(result)
response.content_type = "text/plain"
response.set_header("Content-Length", len(result))
return result
result = '<?xml version="1.0" encoding="UTF-8"?><Error><Code>ForbiddenError</Code><Message>Forbidden Error</Message><RequestId>txfbd566d03042474888193-00608d7537</RequestId></Error>'
@ -27,6 +28,7 @@ def server(_bucket, _path):
@route("/")
def ping():
response.content_type = "text/plain"
response.set_header("Content-Length", 2)
return "OK"

View File

@ -806,7 +806,7 @@ def test_custom_auth_headers_exclusion(started_cluster):
print(result)
assert ei.value.returncode == 243
assert "Forbidden Error" in ei.value.stderr
assert "HTTP response code: 403" in ei.value.stderr
def test_infinite_redirect(started_cluster):