Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-yamux
Commits
fd4aa8d9
Commit
fd4aa8d9
authored
May 04, 2021
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: ensure ping test actually takes time
Otherwise, we'll get a zero RTT on windows.
parent
a16476d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
session_test.go
session_test.go
+13
-0
No files found.
session_test.go
View file @
fd4aa8d9
...
@@ -235,6 +235,13 @@ func TestPing(t *testing.T) {
...
@@ -235,6 +235,13 @@ func TestPing(t *testing.T) {
defer
client
.
Close
()
defer
client
.
Close
()
defer
server
.
Close
()
defer
server
.
Close
()
clientConn
:=
client
.
conn
.
(
*
pipeConn
)
clientConn
.
BlockWrites
()
go
func
()
{
time
.
Sleep
(
time
.
Millisecond
)
clientConn
.
UnblockWrites
()
}()
rtt
,
err
:=
client
.
Ping
()
rtt
,
err
:=
client
.
Ping
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"err: %v"
,
err
)
t
.
Fatalf
(
"err: %v"
,
err
)
...
@@ -243,6 +250,12 @@ func TestPing(t *testing.T) {
...
@@ -243,6 +250,12 @@ func TestPing(t *testing.T) {
t
.
Fatalf
(
"bad: %v"
,
rtt
)
t
.
Fatalf
(
"bad: %v"
,
rtt
)
}
}
clientConn
.
BlockWrites
()
go
func
()
{
time
.
Sleep
(
time
.
Millisecond
)
clientConn
.
UnblockWrites
()
}()
rtt
,
err
=
server
.
Ping
()
rtt
,
err
=
server
.
Ping
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"err: %v"
,
err
)
t
.
Fatalf
(
"err: %v"
,
err
)
...
...
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