Skip to content

Fix TExportToS3Tests.CorruptedDyNumber unit test #5370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions ydb/core/wrappers/ut_helpers/s3_mock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ TS3Mock::TSettings::TSettings()
}

TS3Mock::TSettings::TSettings(ui16 port)
: HttpOptions(TOptions(port).SetThreads(1))
: HttpOptions(THttpServer::TOptions(port).SetThreads(1))
, CorruptETags(false)
, RejectUploadParts(false)
{
}

TS3Mock::TSettings& TS3Mock::TSettings::WithHttpOptions(const TOptions& opts) {
TS3Mock::TSettings& TS3Mock::TSettings::WithHttpOptions(const THttpServer::TOptions& opts) {
HttpOptions = opts;
return *this;
}
Expand Down Expand Up @@ -388,23 +388,27 @@ bool TS3Mock::TRequest::DoReply(const TReplyParams& params) {
}
}

bool TS3Mock::Start() {
return HttpServer.Start();
}

TS3Mock::TS3Mock(const TSettings& settings)
: THttpServer(this, settings.HttpOptions)
, Settings(settings)
: Settings(settings)
, HttpServer(this, settings.HttpOptions)
{
}

TS3Mock::TS3Mock(THashMap<TString, TString>&& data, const TSettings& settings)
: THttpServer(this, settings.HttpOptions)
, Settings(settings)
: Settings(settings)
, Data(std::move(data))
, HttpServer(this, settings.HttpOptions)
{
}

TS3Mock::TS3Mock(const THashMap<TString, TString>& data, const TSettings& settings)
: THttpServer(this, settings.HttpOptions)
, Settings(settings)
: Settings(settings)
, Data(data)
, HttpServer(this, settings.HttpOptions)
{
}

Expand Down
10 changes: 6 additions & 4 deletions ydb/core/wrappers/ut_helpers/s3_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ namespace NKikimr {
namespace NWrappers {
namespace NTestHelpers {

class TS3Mock: public THttpServer, public THttpServer::ICallBack {
class TS3Mock: public THttpServer::ICallBack {
public:
struct TSettings {
TOptions HttpOptions;
THttpServer::TOptions HttpOptions;
bool CorruptETags;
bool RejectUploadParts;

TSettings();
explicit TSettings(ui16 port);

TSettings& WithHttpOptions(const TOptions& opts);
TSettings& WithHttpOptions(const THttpServer::TOptions& opts);
TSettings& WithCorruptETags(bool value);
TSettings& WithRejectUploadParts(bool value);

Expand Down Expand Up @@ -65,7 +65,8 @@ class TS3Mock: public THttpServer, public THttpServer::ICallBack {
explicit TS3Mock(THashMap<TString, TString>&& data, const TSettings& settings = {});
explicit TS3Mock(const THashMap<TString, TString>& data, const TSettings& settings = {});

TClientRequest* CreateClient() override;
TClientRequest* CreateClient();
bool Start();

const THashMap<TString, TString>& GetData() const { return Data; }

Expand All @@ -75,6 +76,7 @@ class TS3Mock: public THttpServer, public THttpServer::ICallBack {

int NextUploadId = 1;
THashMap<std::pair<TString, TString>, TVector<TString>> MultipartUploads;
THttpServer HttpServer;

}; // TS3Mock

Expand Down
Loading