Skip to content

Commit 99f0004

Browse files
authored
Fix TExportToS3Tests.CorruptedDyNumber unit test (#5370)
1 parent fbdeb3c commit 99f0004

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

ydb/core/wrappers/ut_helpers/s3_mock.cpp

+12-8
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ TS3Mock::TSettings::TSettings()
2020
}
2121

2222
TS3Mock::TSettings::TSettings(ui16 port)
23-
: HttpOptions(TOptions(port).SetThreads(1))
23+
: HttpOptions(THttpServer::TOptions(port).SetThreads(1))
2424
, CorruptETags(false)
2525
, RejectUploadParts(false)
2626
{
2727
}
2828

29-
TS3Mock::TSettings& TS3Mock::TSettings::WithHttpOptions(const TOptions& opts) {
29+
TS3Mock::TSettings& TS3Mock::TSettings::WithHttpOptions(const THttpServer::TOptions& opts) {
3030
HttpOptions = opts;
3131
return *this;
3232
}
@@ -388,23 +388,27 @@ bool TS3Mock::TRequest::DoReply(const TReplyParams& params) {
388388
}
389389
}
390390

391+
bool TS3Mock::Start() {
392+
return HttpServer.Start();
393+
}
394+
391395
TS3Mock::TS3Mock(const TSettings& settings)
392-
: THttpServer(this, settings.HttpOptions)
393-
, Settings(settings)
396+
: Settings(settings)
397+
, HttpServer(this, settings.HttpOptions)
394398
{
395399
}
396400

397401
TS3Mock::TS3Mock(THashMap<TString, TString>&& data, const TSettings& settings)
398-
: THttpServer(this, settings.HttpOptions)
399-
, Settings(settings)
402+
: Settings(settings)
400403
, Data(std::move(data))
404+
, HttpServer(this, settings.HttpOptions)
401405
{
402406
}
403407

404408
TS3Mock::TS3Mock(const THashMap<TString, TString>& data, const TSettings& settings)
405-
: THttpServer(this, settings.HttpOptions)
406-
, Settings(settings)
409+
: Settings(settings)
407410
, Data(data)
411+
, HttpServer(this, settings.HttpOptions)
408412
{
409413
}
410414

ydb/core/wrappers/ut_helpers/s3_mock.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ namespace NKikimr {
1111
namespace NWrappers {
1212
namespace NTestHelpers {
1313

14-
class TS3Mock: public THttpServer, public THttpServer::ICallBack {
14+
class TS3Mock: public THttpServer::ICallBack {
1515
public:
1616
struct TSettings {
17-
TOptions HttpOptions;
17+
THttpServer::TOptions HttpOptions;
1818
bool CorruptETags;
1919
bool RejectUploadParts;
2020

2121
TSettings();
2222
explicit TSettings(ui16 port);
2323

24-
TSettings& WithHttpOptions(const TOptions& opts);
24+
TSettings& WithHttpOptions(const THttpServer::TOptions& opts);
2525
TSettings& WithCorruptETags(bool value);
2626
TSettings& WithRejectUploadParts(bool value);
2727

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

68-
TClientRequest* CreateClient() override;
68+
TClientRequest* CreateClient();
69+
bool Start();
6970

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

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

7677
int NextUploadId = 1;
7778
THashMap<std::pair<TString, TString>, TVector<TString>> MultipartUploads;
79+
THttpServer HttpServer;
7880

7981
}; // TS3Mock
8082

0 commit comments

Comments
 (0)