@@ -25,7 +25,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
2525 NYdb::NTable::TTableClient client (driver);
2626 int count = 10 ;
2727
28- std::unordered_set <std::string> sids;
28+ THashSet <std::string> sids;
2929 while (count--) {
3030 auto sessionResponse = client.GetSession ().ExtractValueSync ();
3131 UNIT_ASSERT_EQUAL (sessionResponse.IsTransportError (), false );
@@ -55,8 +55,8 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
5555 NYdb::NTable::TTableClient client (driver);
5656 int count = 10 ;
5757
58- std::vector <TSession> sids;
59- std::vector <TAsyncDataQueryResult> results;
58+ TVector <TSession> sids;
59+ TVector <TAsyncDataQueryResult> results;
6060 while (count--) {
6161 auto sessionResponse = client.GetSession ().ExtractValueSync ();
6262 UNIT_ASSERT_EQUAL (sessionResponse.IsTransportError (), false );
@@ -90,8 +90,8 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
9090 NYdb::NTable::TTableClient client (driver);
9191 int count = 10 ;
9292
93- std::vector <TSession> sids;
94- std::vector <TAsyncDataQueryResult> results;
93+ TVector <TSession> sids;
94+ TVector <TAsyncDataQueryResult> results;
9595 while (count--) {
9696 auto sessionResponse = client.GetSession ().ExtractValueSync ();
9797 UNIT_ASSERT_EQUAL (sessionResponse.IsTransportError (), false );
@@ -189,7 +189,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
189189 };
190190 IThreadFactory* pool = SystemThreadFactory ();
191191
192- std::vector <TAutoPtr<IThreadFactory::IThread>> threads;
192+ TVector <TAutoPtr<IThreadFactory::IThread>> threads;
193193 threads.resize (nThreads);
194194 for (int i = 0 ; i < nThreads; i++) {
195195 threads[i] = pool->Run (job);
@@ -229,12 +229,12 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
229229
230230 constexpr int nThreads = 100 ;
231231 NYdb::EStatus statuses[nThreads];
232- std::vector<std::optional <typename TClient::TSession>> sessions;
232+ TVector<TMaybe <typename TClient::TSession>> sessions;
233233 sessions.resize (nThreads);
234- std::atomic< int > t = 0 ;
234+ TAtomic t = 0 ;
235235 auto job = [client, &t, &statuses, &sessions]() mutable {
236236 auto sessionResponse = client.GetSession ().ExtractValueSync ();
237- int i = ++t ;
237+ int i = AtomicIncrement (t) ;
238238 statuses[--i] = sessionResponse.GetStatus ();
239239 if (statuses[i] == EStatus::SUCCESS) {
240240 EnsureCanExecQuery (sessionResponse.GetSession ());
@@ -243,7 +243,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
243243 };
244244 IThreadFactory* pool = SystemThreadFactory ();
245245
246- std::vector <TAutoPtr<IThreadFactory::IThread>> threads;
246+ TVector <TAutoPtr<IThreadFactory::IThread>> threads;
247247 threads.resize (nThreads);
248248 for (int i = 0 ; i < nThreads; i++) {
249249 threads[i] = pool->Run (job);
@@ -309,14 +309,14 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
309309
310310 constexpr int nThreads = 20 ;
311311 constexpr int nRequests = 50 ;
312- std::array<std::vector <typename T::TResult>, nThreads> results;
312+ std::array<TVector <typename T::TResult>, nThreads> results;
313313 std::atomic<int > t = 0 ;
314314 std::atomic<int > validSessions = 0 ;
315315 auto job = [client, &t, &results, &validSessions]() mutable {
316316 auto sessionResponse = client.GetSession ().ExtractValueSync ();
317317
318318 int i = ++t;
319- std::vector <typename T::TResult>& r = results[--i];
319+ TVector <typename T::TResult>& r = results[--i];
320320
321321 if (sessionResponse.GetStatus () != EStatus::SUCCESS) {
322322 return ;
@@ -329,7 +329,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
329329 };
330330 IThreadFactory* pool = SystemThreadFactory ();
331331
332- std::vector <TAutoPtr<IThreadFactory::IThread>> threads;
332+ TVector <TAutoPtr<IThreadFactory::IThread>> threads;
333333 threads.resize (nThreads);
334334 for (int i = 0 ; i < nThreads; i++) {
335335 threads[i] = pool->Run (job);
@@ -475,7 +475,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
475475 }*/
476476
477477 Y_UNIT_TEST (CloseSessionAfterDriverDtorWithoutSessionPool) {
478- std::vector <std::string> sessionIds;
478+ TVector <std::string> sessionIds;
479479 int iterations = 50 ;
480480
481481 while (iterations--) {
@@ -505,7 +505,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
505505 }
506506
507507 Y_UNIT_TEST (CloseSessionWithSessionPoolExplicit) {
508- std::vector <std::string> sessionIds;
508+ TVector <std::string> sessionIds;
509509 int iterations = 100 ;
510510
511511 while (iterations--) {
@@ -559,7 +559,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
559559 }
560560
561561 Y_UNIT_TEST (CloseSessionWithSessionPoolExplicitDriverStopOnly) {
562- std::vector <std::string> sessionIds;
562+ TVector <std::string> sessionIds;
563563 int iterations = 100 ;
564564
565565 while (iterations--) {
@@ -601,7 +601,7 @@ Y_UNIT_TEST_SUITE(YdbSdkSessions) {
601601 }
602602
603603 Y_UNIT_TEST (CloseSessionWithSessionPoolFromDtors) {
604- std::vector <std::string> sessionIds;
604+ TVector <std::string> sessionIds;
605605 int iterations = 100 ;
606606
607607 while (iterations--) {
0 commit comments