Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
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
tsai
StackExchange.Redis
Commits
7e0a48cd
Commit
7e0a48cd
authored
Aug 06, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expose connection name to test suite
parent
71426b0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
BasicOps.cs
StackExchange.Redis.Tests/BasicOps.cs
+6
-2
PhysicalBridge.cs
StackExchange.Redis/StackExchange/Redis/PhysicalBridge.cs
+1
-0
RedisSubscriber.cs
StackExchange.Redis/StackExchange/Redis/RedisSubscriber.cs
+3
-0
No files found.
StackExchange.Redis.Tests/BasicOps.cs
View file @
7e0a48cd
...
@@ -294,15 +294,19 @@ public async Task TestQuit()
...
@@ -294,15 +294,19 @@ public async Task TestQuit()
string
key
=
Guid
.
NewGuid
().
ToString
();
string
key
=
Guid
.
NewGuid
().
ToString
();
db
.
KeyDelete
(
key
,
CommandFlags
.
FireAndForget
);
db
.
KeyDelete
(
key
,
CommandFlags
.
FireAndForget
);
db
.
StringSet
(
key
,
key
,
flags
:
CommandFlags
.
FireAndForget
);
db
.
StringSet
(
key
,
key
,
flags
:
CommandFlags
.
FireAndForget
);
Log
(
"{0}: Issuing QUIT"
,
Time
());
var
ep
=
muxer
.
GetEndPoints
()[
0
];
var
nameBefore
=
muxer
.
GetConnectionName
(
ep
,
ConnectionType
.
Interactive
);
Log
(
"{0}: Issuing QUIT to {1}"
,
Time
(),
nameBefore
);
GetServer
(
muxer
).
Execute
(
"QUIT"
,
null
);
GetServer
(
muxer
).
Execute
(
"QUIT"
,
null
);
var
watch
=
Stopwatch
.
StartNew
();
var
watch
=
Stopwatch
.
StartNew
();
Assert
.
Throws
<
RedisConnectionException
>(()
=>
Log
(
"Ping time: "
+
db
.
Ping
().
ToString
()));
Assert
.
Throws
<
RedisConnectionException
>(()
=>
Log
(
"Ping time: "
+
db
.
Ping
().
ToString
()));
watch
.
Stop
();
watch
.
Stop
();
Log
(
"Time to notice quit: {0}ms (any order)"
,
watch
.
ElapsedMilliseconds
);
Log
(
"Time to notice quit: {0}ms (any order)"
,
watch
.
ElapsedMilliseconds
);
await
Task
.
Delay
(
20
).
ForAwait
();
await
Task
.
Delay
(
20
).
ForAwait
();
Debug
.
WriteLine
(
"Pinging..."
);
var
nameAfter
=
muxer
.
GetConnectionName
(
ep
,
ConnectionType
.
Interactive
);
Log
(
"{0}: Not talking to {1}"
,
Time
(),
nameAfter
);
Assert
.
Equal
(
key
,
(
string
)
db
.
StringGet
(
key
));
Assert
.
Equal
(
key
,
(
string
)
db
.
StringGet
(
key
));
Assert
.
NotEqual
(
nameBefore
,
nameAfter
);
}
}
}
}
...
...
StackExchange.Redis/StackExchange/Redis/PhysicalBridge.cs
View file @
7e0a48cd
...
@@ -41,6 +41,7 @@ internal sealed partial class PhysicalBridge : IDisposable
...
@@ -41,6 +41,7 @@ internal sealed partial class PhysicalBridge : IDisposable
private
volatile
int
state
=
(
int
)
State
.
Disconnected
;
private
volatile
int
state
=
(
int
)
State
.
Disconnected
;
internal
string
PhysicalName
=>
physical
?.
ToString
();
public
PhysicalBridge
(
ServerEndPoint
serverEndPoint
,
ConnectionType
type
,
int
timeoutMilliseconds
)
public
PhysicalBridge
(
ServerEndPoint
serverEndPoint
,
ConnectionType
type
,
int
timeoutMilliseconds
)
{
{
ServerEndPoint
=
serverEndPoint
;
ServerEndPoint
=
serverEndPoint
;
...
...
StackExchange.Redis/StackExchange/Redis/RedisSubscriber.cs
View file @
7e0a48cd
...
@@ -249,6 +249,9 @@ internal bool Validate(ConnectionMultiplexer multiplexer, RedisChannel channel)
...
@@ -249,6 +249,9 @@ internal bool Validate(ConnectionMultiplexer multiplexer, RedisChannel channel)
}
}
}
}
internal
string
GetConnectionName
(
EndPoint
endPoint
,
ConnectionType
connectionType
)
=>
GetServerEndPoint
(
endPoint
)?.
GetBridge
(
connectionType
,
false
)?.
PhysicalName
;
#if TEST
#if TEST
internal
event
Action
<
string
,
Exception
,
string
>
MessageFaulted
;
internal
event
Action
<
string
,
Exception
,
string
>
MessageFaulted
;
internal
event
Action
<
bool
>
Closing
;
internal
event
Action
<
bool
>
Closing
;
...
...
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