Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
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
core
tarantool
Commits
fa66c295
Commit
fa66c295
authored
4 years ago
by
Alexander V. Tikhonov
Committed by
Kirill Yukhin
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
test: move error messages into logs gh-5383
Set error message to log output in test: vinyl/gc.test.lua
parent
e95aec95
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
test/vinyl/gc.result
+10
-8
10 additions, 8 deletions
test/vinyl/gc.result
test/vinyl/gc.test.lua
+9
-7
9 additions, 7 deletions
test/vinyl/gc.test.lua
with
19 additions
and
15 deletions
test/vinyl/gc.result
+
10
−
8
View file @
fa66c295
...
...
@@ -39,10 +39,12 @@ function ls_data() return fio.glob(fio.pathjoin(path, '*')) end
function ls_vylog() return fio.glob(fio.pathjoin(box.cfg.vinyl_dir, '*.vylog')) end
---
...
function gc
_info() return box.info.gc
() end
function gc
() temp:auto_increment{} box.snapshot
() end
---
...
function gc() temp:auto_increment{} box.snapshot() end
function check_files_number(fnum) return (#files == fnum or \
(require('log').error(files) or \
require('log').error(box.info.gc()))) end
---
...
-- Check that run files are deleted by gc.
...
...
@@ -61,7 +63,7 @@ gc()
files = ls_data()
---
...
#files == 2 or {files, gc_info()}
check_files_number(2)
---
- true
...
...
...
@@ -69,7 +71,7 @@ files = ls_data()
files = ls_vylog()
---
...
#files == 2 or {files, gc_info()}
check_files_number(2)
---
- true
...
...
...
@@ -83,7 +85,7 @@ gc()
files = ls_data()
---
...
#files == 0 or {files, gc_info()}
check_files_number(0)
---
- true
...
...
...
@@ -98,7 +100,7 @@ gc()
files = ls_vylog()
---
...
#files == 2 or {files, gc_info()}
check_files_number(2)
---
- true
...
...
...
@@ -110,7 +112,7 @@ gc()
files = ls_vylog()
---
...
#files == 1 or {files, gc_info()}
check_files_number(1)
---
- true
...
...
...
@@ -121,7 +123,7 @@ gc()
files = ls_vylog()
---
...
#files == 0 or {files, gc_info()}
check_files_number(0)
---
- true
...
...
...
This diff is collapsed.
Click to expand it.
test/vinyl/gc.test.lua
+
9
−
7
View file @
fa66c295
...
...
@@ -19,8 +19,10 @@ path = fio.pathjoin(box.cfg.vinyl_dir, tostring(s.id), tostring(s.index.pk.id))
function
ls_data
()
return
fio
.
glob
(
fio
.
pathjoin
(
path
,
'*'
))
end
function
ls_vylog
()
return
fio
.
glob
(
fio
.
pathjoin
(
box
.
cfg
.
vinyl_dir
,
'*.vylog'
))
end
function
gc_info
()
return
box
.
info
.
gc
()
end
function
gc
()
temp
:
auto_increment
{}
box
.
snapshot
()
end
function
check_files_number
(
fnum
)
return
(
#
files
==
fnum
or
\
(
require
(
'log'
).
error
(
files
)
or
\
require
(
'log'
).
error
(
box
.
info
.
gc
())))
end
-- Check that run files are deleted by gc.
s
:
insert
{
1
}
box
.
snapshot
()
-- dump
...
...
@@ -28,17 +30,17 @@ s:insert{2} box.snapshot() -- dump + compaction
while
s
.
index
.
pk
:
stat
().
run_count
>
1
do
fiber
.
sleep
(
0
.
01
)
end
-- wait for compaction
gc
()
files
=
ls_data
()
#
files
==
2
or
{
files
,
gc_info
()}
check_files_number
(
2
)
-- Check that gc keeps the current and previous log files.
files
=
ls_vylog
()
#
files
==
2
or
{
files
,
gc_info
()}
check_files_number
(
2
)
-- Check that files left from dropped indexes are deleted by gc.
s
:
drop
()
gc
()
files
=
ls_data
()
#
files
==
0
or
{
files
,
gc_info
()}
check_files_number
(
0
)
--
-- Check that vylog files are removed if vinyl is not used.
...
...
@@ -48,18 +50,18 @@ files = ls_data()
-- dropped index records are still stored in vylog.
gc
()
files
=
ls_vylog
()
#
files
==
2
or
{
files
,
gc_info
()}
check_files_number
(
2
)
-- All records should have been purged from the log by now
-- so we should only keep the previous log file.
gc
()
files
=
ls_vylog
()
#
files
==
1
or
{
files
,
gc_info
()}
check_files_number
(
1
)
-- The previous log file should be removed by the next gc.
gc
()
files
=
ls_vylog
()
#
files
==
0
or
{
files
,
gc_info
()}
check_files_number
(
0
)
temp
:
drop
()
...
...
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