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
f5f9b140
Commit
f5f9b140
authored
Jun 02, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests: Better logging on cluster, so we can figure out what's happening on Appveyor
parent
09b6613f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
Cluster.cs
StackExchange.Redis.Tests/Cluster.cs
+25
-3
No files found.
StackExchange.Redis.Tests/Cluster.cs
View file @
f5f9b140
...
...
@@ -65,15 +65,34 @@ public void CanGetTotalStats()
}
}
private
void
PrintEndpoints
(
EndPoint
[]
endpoints
)
{
Output
.
WriteLine
(
$"Endpoints Expected:
{
TestConfig
.
Current
.
ClusterStartPort
}
+
{
TestConfig
.
Current
.
ClusterServerCount
}
"
);
Output
.
WriteLine
(
"Endpoints Found:"
);
foreach
(
var
endpoint
in
endpoints
)
{
Output
.
WriteLine
(
" Endpoint: "
+
endpoint
);
}
}
[
Fact
]
public
void
Connect
()
{
using
(
var
muxer
=
Create
())
var
expectedPorts
=
new
HashSet
<
int
>(
Enumerable
.
Range
(
TestConfig
.
Current
.
ClusterStartPort
,
TestConfig
.
Current
.
ClusterServerCount
));
using
(
var
sw
=
new
StringWriter
())
using
(
var
muxer
=
Create
(
log
:
sw
))
{
var
endpoints
=
muxer
.
GetEndPoints
();
if
(
TestConfig
.
Current
.
ClusterServerCount
!=
endpoints
.
Length
)
{
PrintEndpoints
(
endpoints
);
}
else
{
Output
.
WriteLine
(
sw
.
ToString
());
}
Assert
.
Equal
(
TestConfig
.
Current
.
ClusterServerCount
,
endpoints
.
Length
);
var
expectedPorts
=
new
HashSet
<
int
>(
Enumerable
.
Range
(
TestConfig
.
Current
.
ClusterStartPort
,
TestConfig
.
Current
.
ClusterServerCount
));
int
masters
=
0
,
slaves
=
0
;
var
failed
=
new
List
<
EndPoint
>();
foreach
(
var
endpoint
in
endpoints
)
...
...
@@ -428,7 +447,8 @@ public void SScan()
[
Fact
]
public
void
GetConfig
()
{
using
(
var
muxer
=
Create
(
allowAdmin
:
true
))
using
(
var
sw
=
new
StringWriter
())
using
(
var
muxer
=
Create
(
allowAdmin
:
true
,
log
:
sw
))
{
var
endpoints
=
muxer
.
GetEndPoints
();
var
server
=
muxer
.
GetServer
(
endpoints
[
0
]);
...
...
@@ -444,6 +464,8 @@ public void GetConfig()
{
Output
.
WriteLine
(
node
.
ToString
());
}
Output
.
WriteLine
(
sw
.
ToString
());
Assert
.
Equal
(
TestConfig
.
Current
.
ClusterServerCount
,
endpoints
.
Length
);
Assert
.
Equal
(
TestConfig
.
Current
.
ClusterServerCount
,
nodes
.
Nodes
.
Count
);
}
...
...
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