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
474abd9c
Unverified
Commit
474abd9c
authored
Sep 29, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Use a long timeout when waiting for next block and keep test code simple.
parent
3618dbb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
12 deletions
+5
-12
blocks.go
op-e2e/e2eutils/wait/blocks.go
+3
-10
system_adminrpc_test.go
op-e2e/system_adminrpc_test.go
+2
-2
No files found.
op-e2e/e2eutils/wait/blocks.go
View file @
474abd9c
...
...
@@ -49,18 +49,11 @@ func ForBlockWithTimestamp(ctx context.Context, client BlockCaller, target uint6
func
ForNextBlock
(
ctx
context
.
Context
,
client
BlockCaller
)
error
{
current
,
err
:=
client
.
BlockNumber
(
ctx
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"get starting block number: %w"
,
err
)
}
return
ForBlock
(
ctx
,
client
,
current
+
1
)
}
func
ForNextBlockWithTimeout
(
ctx
context
.
Context
,
client
BlockCaller
,
timeout
time
.
Duration
)
error
{
timeoutCtx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
timeout
)
// Long timeout so we don't have to care what the block time is. If the test passes this will complete early anyway.
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
60
*
time
.
Second
)
defer
cancel
()
current
,
err
:=
client
.
BlockNumber
(
ctx
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"get starting block number: %w"
,
err
)
}
return
ForBlock
(
timeoutC
tx
,
client
,
current
+
1
)
return
ForBlock
(
c
tx
,
client
,
current
+
1
)
}
op-e2e/system_adminrpc_test.go
View file @
474abd9c
...
...
@@ -37,7 +37,7 @@ func TestStopStartSequencer(t *testing.T) {
require
.
NoError
(
t
,
wait
.
ForNextBlock
WithTimeout
(
ctx
,
l2Seq
,
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
2
*
time
.
Second
),
wait
.
ForNextBlock
(
ctx
,
l2Seq
),
"Chain did not advance after starting sequencer"
,
)
...
...
@@ -70,7 +70,7 @@ func TestStopStartSequencer(t *testing.T) {
require
.
NoError
(
t
,
wait
.
ForNextBlock
WithTimeout
(
ctx
,
l2Seq
,
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
2
*
time
.
Second
),
wait
.
ForNextBlock
(
ctx
,
l2Seq
),
"Chain did not advance after starting sequencer"
,
)
}
...
...
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