Skip to content

Commit 13578f5

Browse files
committed
fix TExportToS3Tests.CorruptedDyNumber unit test
1 parent 29c0360 commit 13578f5

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.github/config/muted_ya.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ ydb/core/tx/columnshard/ut_schema TColumnShardTestSchema.RebootForgetAfterFail
2828
ydb/core/tx/columnshard/engines/ut *
2929
ydb/core/tx/coordinator/ut Coordinator.RestoreTenantConfiguration
3030
ydb/core/tx/datashard/ut_change_exchange Cdc.InitialScanDebezium
31-
ydb/core/tx/schemeshard/ut_export TExportToS3Tests.CorruptedDyNumber
3231
ydb/core/tx/schemeshard/ut_restore TImportTests.ShouldSucceedOnManyTables
3332
ydb/core/tx/schemeshard/ut_split_merge TSchemeShardSplitBySizeTest.Merge1KShards
3433
ydb/core/tx/tx_proxy/ut_ext_tenant TExtSubDomainTest.CreateTableInsideAndAlterDomainAndTable-AlterDatabaseCreateHiveFirst*

ydb/core/wrappers/ut_helpers/s3_mock.cpp

Lines changed: 12 additions & 8 deletions
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

Lines changed: 6 additions & 4 deletions
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)