forked from ydb-platform/ydb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YQ-2803 Exception checking in checkpoint storages (ydb-platform#1540)
* Exception check * Add new line * remove comment * Use StatusToIssues() * remove some std::move * remove ;
- Loading branch information
1 parent
112425d
commit faf3e89
Showing
6 changed files
with
61 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
UNITTEST_FOR(ydb/core/fq/libs/ydb) | ||
|
||
SRCS( | ||
ydb_ut.cpp | ||
) | ||
|
||
PEERDIR( | ||
ydb/core/fq/libs/ydb | ||
) | ||
|
||
END() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <ydb/core/fq/libs/ydb/ydb.h> | ||
|
||
#include <library/cpp/testing/unittest/registar.h> | ||
|
||
namespace NFq { | ||
|
||
Y_UNIT_TEST_SUITE(TFqYdbTest) { | ||
|
||
Y_UNIT_TEST(ShouldStatusToIssuesProcessExceptions) | ||
{ | ||
auto promise = NThreading::NewPromise<NYdb::TStatus>(); | ||
auto future = promise.GetFuture(); | ||
TString text("Test exception"); | ||
promise.SetException(text); | ||
NThreading::TFuture<NYql::TIssues> future2 = NFq::StatusToIssues(future); | ||
|
||
NYql::TIssues issues = future2.GetValueSync(); | ||
UNIT_ASSERT(issues.Size() == 1); | ||
UNIT_ASSERT(issues.ToString().Contains(text)); | ||
} | ||
} | ||
|
||
} // namespace NFq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,7 @@ GENERATE_ENUM_SERIALIZATION(ydb.h) | |
YQL_LAST_ABI_VERSION() | ||
|
||
END() | ||
|
||
RECURSE_FOR_TESTS( | ||
ut | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters