Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
picodata
Merge requests
!371
Several on_shutdown test enhancements
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Several on_shutdown test enhancements
test-shutdown
into
master
Overview
0
Commits
3
Pipelines
4
Changes
2
Merged
Yaroslav Dynnikov
requested to merge
test-shutdown
into
master
2 years ago
Overview
0
Commits
3
Pipelines
4
Changes
2
Expand
test: fix on_shutdown test log parsing
test: refactor gl119_panic_on_shutdown
test: single out shutdown tests
0
0
Merge request reports
Compare
master
version 3
30e4538e
2 years ago
version 2
0b2805bb
2 years ago
version 1
6190d5d8
2 years ago
master (base)
and
latest version
latest version
f52d7156
3 commits,
2 years ago
version 3
30e4538e
3 commits,
2 years ago
version 2
0b2805bb
3 commits,
2 years ago
version 1
6190d5d8
3 commits,
2 years ago
2 files
+
58
−
45
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
test/int/test_couple.py
+
0
−
45
Options
import
funcy
# type: ignore
import
pytest
from
conftest
import
Cluster
,
Instance
from
time
import
sleep
@funcy.retry
(
tries
=
20
,
timeout
=
0.1
)
@@ -120,47 +119,3 @@ def test_restart_both(cluster2: Cluster):
i1
.
raft_propose_eval
(
"
rawset(_G,
'
check
'
, true)
"
)
assert
i1
.
eval
(
"
return check
"
)
is
True
assert
i2
.
eval
(
"
return check
"
)
is
True
def
test_gl119_panic_in_on_shutdown
(
cluster2
:
Cluster
):
i1
,
i2
=
cluster2
.
instances
i2
.
call
(
"
picolib.raft_timeout_now
"
,
timeout
=
0.01
)
assert
i2
.
terminate
()
==
0
# second instance terminates first, so it becomes a follower
i2
.
terminate
()
# terminate the leader, so the follower can't acquire the read barrier
i1
.
terminate
()
i2
.
start
()
# wait for the follower to start acquiring the read barrier
sleep
(
1
)
assert
i2
.
terminate
()
==
0
# it's 2022 and i have to work around a mypy bug reported in 2018
on_shutdown_timed_out
:
bool
def
test_gl127_graceul_shutdown
(
cluster2
:
Cluster
):
i1
,
i2
=
cluster2
.
instances
# make sure i1 is leader
i1
.
promote_or_fail
()
i2
.
wait_online
()
global
on_shutdown_timed_out
on_shutdown_timed_out
=
False
def
check_log_line
(
log
):
if
"
on_shutdown triggers are timed out
"
in
log
:
global
on_shutdown_timed_out
on_shutdown_timed_out
=
True
i1
.
on_output_line
(
check_log_line
)
# on_shutdown triggers will timeout after 3sec
# so we must wait longer than # that
i1
.
terminate
(
kill_after_seconds
=
10
)
assert
not
on_shutdown_timed_out
Loading