Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22fa00199
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22fa00199
Commits
ae70cfee
Unverified
Commit
ae70cfee
authored
2 years ago
by
XuPeng-SH
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
(tae): update ut for sleep time (#2878)
parent
6ffed88c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/vm/engine/aoe/storage/db/db.go
+2
-0
2 additions, 0 deletions
pkg/vm/engine/aoe/storage/db/db.go
pkg/vm/engine/tae/db/scheduler_test.go
+9
-5
9 additions, 5 deletions
pkg/vm/engine/tae/db/scheduler_test.go
with
11 additions
and
5 deletions
pkg/vm/engine/aoe/storage/db/db.go
+
2
−
0
View file @
ae70cfee
...
...
@@ -254,6 +254,8 @@ func (d *DB) ApplySnapshot(dbName string, path string) error {
var
err
error
database
,
_
:=
d
.
Store
.
Catalog
.
SimpleGetDatabaseByName
(
dbName
)
loader
:=
NewDBSSLoader
(
d
.
Store
.
Catalog
,
database
,
d
.
Store
.
DataTables
,
path
)
// TODO: Tem workaround
time
.
Sleep
(
time
.
Microsecond
*
10
)
if
err
=
loader
.
PrepareLoad
();
err
!=
nil
{
return
err
}
...
...
This diff is collapsed.
Click to expand it.
pkg/vm/engine/tae/db/scheduler_test.go
+
9
−
5
View file @
ae70cfee
...
...
@@ -121,9 +121,10 @@ func TestCheckpoint1(t *testing.T) {
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
txn
.
Commit
())
}
time
.
Sleep
(
time
.
Millisecond
*
20
)
{
blockCnt
:=
0
blockCnt
:=
0
fn
:=
func
()
bool
{
blockCnt
=
0
blockFn
:=
func
(
entry
*
catalog
.
BlockEntry
)
error
{
blockCnt
++
return
nil
...
...
@@ -131,9 +132,12 @@ func TestCheckpoint1(t *testing.T) {
processor
:=
new
(
catalog
.
LoopProcessor
)
processor
.
BlockFn
=
blockFn
err
:=
db
.
Opts
.
Catalog
.
RecurLoop
(
processor
)
assert
.
N
il
(
t
,
err
)
assert
.
Equal
(
t
,
2
+
3
,
blockCnt
)
assert
.
N
oError
(
t
,
err
)
return
blockCnt
==
2
+
3
}
testutils
.
WaitExpect
(
1000
,
fn
)
fn
()
assert
.
Equal
(
t
,
2
+
3
,
blockCnt
)
}
func
TestCheckpoint2
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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