Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cppinttest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cppinttest
Commits
000817dc
Commit
000817dc
authored
1 year ago
by
Timm Fitschen
Browse files
Options
Downloads
Plain Diff
Merge branch 'f-fix-async-timeout' into 'dev'
fix async timeout See merge request
!29
parents
d17869cf
99860939
No related branches found
Branches containing commit
No related tags found
1 merge request
!29
fix async timeout
Pipeline
#42265
passed
1 year ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
2
Pipelines
34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
test/test_async.cpp
+12
-6
12 additions, 6 deletions
test/test_async.cpp
with
14 additions
and
6 deletions
CHANGELOG.md
+
2
−
0
View file @
000817dc
...
...
@@ -19,4 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
*
Fixed failing async test.
### Security
This diff is collapsed.
Click to expand it.
test/test_async.cpp
+
12
−
6
View file @
000817dc
...
...
@@ -53,13 +53,19 @@ TEST(test_async, retrieve_non_existing) {
auto
status
=
transaction
->
GetStatus
();
EXPECT_EQ
(
status
.
GetCode
(),
StatusCode
::
EXECUTING
);
// wait some time
std
::
this_thread
::
sleep_for
(
1000ms
);
// 1000ms are not always sufficient, when there is very high pipeline load.
auto
count
=
1000
;
auto
code
=
transaction
->
GetStatus
().
GetCode
();
do
{
// wait some time
std
::
this_thread
::
sleep_for
(
10ms
);
// DONT call WaitForIt -> the transaction finishes in the back-ground
status
=
transaction
->
GetStatus
();
EXPECT_EQ
(
status
.
GetCode
(),
TransactionStatus
::
TRANSACTION_ERROR
().
GetCode
());
ASSERT_EQ
(
status
.
GetCode
(),
StatusCode
::
GENERIC_TRANSACTION_ERROR
);
// DONT call WaitForIt -> the transaction finishes in the background
code
=
transaction
->
GetStatus
().
GetCode
();
}
while
(
--
count
>
0
&&
code
==
StatusCode
::
EXECUTING
);
ASSERT_GT
(
count
,
0
)
<<
"ERROR: Timeout while waiting for transaction."
;
EXPECT_EQ
(
code
,
TransactionStatus
::
TRANSACTION_ERROR
().
GetCode
());
ASSERT_EQ
(
code
,
StatusCode
::
GENERIC_TRANSACTION_ERROR
);
const
auto
&
result_set
=
transaction
->
GetResultSet
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment