Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
794a333b
Unverified
Commit
794a333b
authored
Apr 30, 2024
by
Danyal Prout
Committed by
GitHub
May 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure conductor services are closed (#10347)
parent
b952dc06
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
sequencer_failover_setup.go
op-e2e/sequencer_failover_setup.go
+7
-2
sequencer_failover_test.go
op-e2e/sequencer_failover_test.go
+10
-6
No files found.
op-e2e/sequencer_failover_setup.go
View file @
794a333b
...
...
@@ -59,7 +59,7 @@ func (c *conductor) RPCEndpoint() string {
return
fmt
.
Sprintf
(
"http://%s:%d"
,
localhost
,
c
.
rpcPort
)
}
func
setupSequencerFailoverTest
(
t
*
testing
.
T
)
(
*
System
,
map
[
string
]
*
conductor
)
{
func
setupSequencerFailoverTest
(
t
*
testing
.
T
)
(
*
System
,
map
[
string
]
*
conductor
,
func
()
)
{
InitParallel
(
t
)
ctx
:=
context
.
Background
()
...
...
@@ -129,7 +129,12 @@ func setupSequencerFailoverTest(t *testing.T) (*System, map[string]*conductor) {
require
.
True
(
t
,
healthy
(
t
,
ctx
,
c2
))
require
.
True
(
t
,
healthy
(
t
,
ctx
,
c3
))
return
sys
,
conductors
return
sys
,
conductors
,
func
()
{
sys
.
Close
()
for
_
,
c
:=
range
conductors
{
_
=
c
.
service
.
Stop
(
ctx
)
}
}
}
func
setupHAInfra
(
t
*
testing
.
T
,
ctx
context
.
Context
)
(
*
System
,
map
[
string
]
*
conductor
,
error
)
{
...
...
op-e2e/sequencer_failover_test.go
View file @
794a333b
...
...
@@ -14,8 +14,8 @@ import (
// [Category: Initial Setup]
// In this test, we test that we can successfully setup a working cluster.
func
TestSequencerFailover_SetupCluster
(
t
*
testing
.
T
)
{
sys
,
conductors
:=
setupSequencerFailoverTest
(
t
)
defer
sys
.
Close
()
_
,
conductors
,
cleanup
:=
setupSequencerFailoverTest
(
t
)
defer
cleanup
()
require
.
Equal
(
t
,
3
,
len
(
conductors
),
"Expected 3 conductors"
)
for
_
,
con
:=
range
conductors
{
...
...
@@ -27,8 +27,8 @@ func TestSequencerFailover_SetupCluster(t *testing.T) {
// In this test, we test all rpcs exposed by conductor.
func
TestSequencerFailover_ConductorRPC
(
t
*
testing
.
T
)
{
ctx
:=
context
.
Background
()
sys
,
conductors
:=
setupSequencerFailoverTest
(
t
)
defer
sys
.
Close
()
sys
,
conductors
,
cleanup
:=
setupSequencerFailoverTest
(
t
)
defer
cleanup
()
// SequencerHealthy, Leader, AddServerAsVoter are used in setup already.
...
...
@@ -107,6 +107,10 @@ func TestSequencerFailover_ConductorRPC(t *testing.T) {
)
})
require
.
NoError
(
t
,
err
)
defer
func
()
{
err
=
nonvoter
.
service
.
Stop
(
ctx
)
require
.
NoError
(
t
,
err
)
}()
err
=
leader
.
client
.
AddServerAsNonvoter
(
ctx
,
VerifierName
,
nonvoter
.
ConsensusEndpoint
())
require
.
NoError
(
t
,
err
,
"Expected leader to add non-voter"
)
...
...
@@ -144,8 +148,8 @@ func TestSequencerFailover_ConductorRPC(t *testing.T) {
// [Category: Sequencer Failover]
// Test that the sequencer can successfully failover to a new sequencer once the active sequencer goes down.
func
TestSequencerFailover_ActiveSequencerDown
(
t
*
testing
.
T
)
{
sys
,
conductors
:=
setupSequencerFailoverTest
(
t
)
defer
sys
.
Close
()
sys
,
conductors
,
cleanup
:=
setupSequencerFailoverTest
(
t
)
defer
cleanup
()
ctx
:=
context
.
Background
()
leaderId
,
leader
:=
findLeader
(
t
,
conductors
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment