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
67d23ca1
Commit
67d23ca1
authored
Mar 20, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests host:port cleanup
There were several mismatches here...this should help avoid future ones.
parent
72b1cbab
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
734 additions
and
729 deletions
+734
-729
AsyncTests.cs
StackExchange.Redis.Tests/AsyncTests.cs
+1
-1
ConnectionShutdown.cs
StackExchange.Redis.Tests/ConnectionShutdown.cs
+2
-2
TestConfig.cs
StackExchange.Redis.Tests/Helpers/TestConfig.cs
+3
-0
DefaultDatabase.cs
StackExchange.Redis.Tests/Issues/DefaultDatabase.cs
+2
-2
Issue182.cs
StackExchange.Redis.Tests/Issues/Issue182.cs
+72
-72
Issue791.cs
StackExchange.Redis.Tests/Issues/Issue791.cs
+1
-1
SO25567566.cs
StackExchange.Redis.Tests/Issues/SO25567566.cs
+2
-2
Keys.cs
StackExchange.Redis.Tests/Keys.cs
+1
-1
Locking.cs
StackExchange.Redis.Tests/Locking.cs
+1
-1
MultiMaster.cs
StackExchange.Redis.Tests/MultiMaster.cs
+17
-17
PubSubNonParallel.cs
StackExchange.Redis.Tests/PubSubNonParallel.cs
+14
-12
Scripting.cs
StackExchange.Redis.Tests/Scripting.cs
+522
-522
Secure.cs
StackExchange.Redis.Tests/Secure.cs
+94
-94
TestBase.cs
StackExchange.Redis.Tests/TestBase.cs
+2
-2
No files found.
StackExchange.Redis.Tests/AsyncTests.cs
View file @
67d23ca1
...
...
@@ -8,7 +8,7 @@ public class AsyncTests : TestBase
{
public
AsyncTests
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
;
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
And
Port
;
#if DEBUG // IRedisServerDebug and AllowConnect are only available if DEBUG is defined
[
Fact
]
...
...
StackExchange.Redis.Tests/ConnectionShutdown.cs
View file @
67d23ca1
...
...
@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests
{
public
class
ConnectionShutdown
:
TestBase
{
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
;
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
And
Port
;
public
ConnectionShutdown
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
[
Fact
(
Skip
=
"Unfriendly"
)]
...
...
StackExchange.Redis.Tests/Helpers/TestConfig.cs
View file @
67d23ca1
...
...
@@ -42,13 +42,16 @@ public class Config
public
string
MasterServer
{
get
;
set
;
}
=
"127.0.0.1"
;
public
int
MasterPort
{
get
;
set
;
}
=
6379
;
public
string
MasterServerAndPort
=>
MasterServer
+
":"
+
MasterPort
.
ToString
();
public
string
SlaveServer
{
get
;
set
;
}
=
"127.0.0.1"
;
public
int
SlavePort
{
get
;
set
;
}
=
6380
;
public
string
SlaveServerAndPort
=>
SlaveServer
+
":"
+
SlavePort
.
ToString
();
public
string
SecureServer
{
get
;
set
;
}
=
"127.0.0.1"
;
public
int
SecurePort
{
get
;
set
;
}
=
6381
;
public
string
SecurePassword
{
get
;
set
;
}
=
"changeme"
;
public
string
SecureServerAndPort
=>
SecureServer
+
":"
+
SecurePort
.
ToString
();
public
string
IPv4Server
{
get
;
set
;
}
=
"127.0.0.1"
;
public
int
IPv4Port
{
get
;
set
;
}
=
6379
;
...
...
StackExchange.Redis.Tests/Issues/DefaultDatabase.cs
View file @
67d23ca1
...
...
@@ -28,7 +28,7 @@ public void ConfigurationOptions_UnspecifiedDefaultDb()
var
log
=
new
StringWriter
();
try
{
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
$"
{
TestConfig
.
Current
.
MasterServer
}
:
{
TestConfig
.
Current
.
MasterPort
}
"
,
log
))
{
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
TestConfig
.
Current
.
MasterServerAndPort
,
log
))
{
var
db
=
conn
.
GetDatabase
();
Assert
.
Equal
(
0
,
db
.
Database
);
}
...
...
@@ -45,7 +45,7 @@ public void ConfigurationOptions_SpecifiedDefaultDb()
var
log
=
new
StringWriter
();
try
{
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
$"
{
TestConfig
.
Current
.
MasterServer
}
:
{
TestConfig
.
Current
.
Master
Port
}
,defaultDatabase=3"
,
log
))
{
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
$"
{
TestConfig
.
Current
.
MasterServer
And
Port
}
,defaultDatabase=3"
,
log
))
{
var
db
=
conn
.
GetDatabase
();
Assert
.
Equal
(
3
,
db
.
Database
);
}
...
...
StackExchange.Redis.Tests/Issues/Issue182.cs
View file @
67d23ca1
...
...
@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests.Issues
{
public
class
Issue182
:
TestBase
{
protected
override
string
GetConfiguration
()
=>
$"
{
TestConfig
.
Current
.
MasterServer
}
:
{
TestConfig
.
Current
.
MasterPort
}
,responseTimeout=10000"
;
protected
override
string
GetConfiguration
()
=>
$"
{
TestConfig
.
Current
.
MasterServer
AndPort
}
,responseTimeout=10000"
;
public
Issue182
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
...
...
StackExchange.Redis.Tests/Issues/Issue791.cs
View file @
67d23ca1
...
...
@@ -29,7 +29,7 @@ public void DefaultValue_IsTrue()
[
Fact
]
public
void
PreserveAsyncOrder_SetConnectionMultiplexerProperty
()
{
var
multiplexer
=
ConnectionMultiplexer
.
Connect
(
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
+
",preserveAsyncOrder=false"
);
var
multiplexer
=
ConnectionMultiplexer
.
Connect
(
TestConfig
.
Current
.
MasterServer
And
Port
+
",preserveAsyncOrder=false"
);
Assert
.
False
(
multiplexer
.
PreserveAsyncOrder
);
}
}
...
...
StackExchange.Redis.Tests/Issues/SO25567566.cs
View file @
67d23ca1
...
...
@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests.Issues
{
public
class
SO25567566
:
TestBase
{
protected
override
string
GetConfiguration
()
=>
$"
{
TestConfig
.
Current
.
MasterServer
}
:
{
TestConfig
.
Current
.
MasterPort
}
"
;
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServerAndPort
;
public
SO25567566
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
[
FactLongRunning
]
...
...
StackExchange.Redis.Tests/Keys.cs
View file @
67d23ca1
...
...
@@ -34,7 +34,7 @@ public void RandomKey()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
var
db
=
conn
.
GetDatabase
();
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
Master
Port
).
FlushDatabase
();
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
And
Port
).
FlushDatabase
();
string
anyKey
=
db
.
KeyRandom
();
Assert
.
Null
(
anyKey
);
...
...
StackExchange.Redis.Tests/Locking.cs
View file @
67d23ca1
...
...
@@ -9,7 +9,7 @@ namespace StackExchange.Redis.Tests
{
public
class
Locking
:
TestBase
{
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
;
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
And
Port
;
public
Locking
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
public
enum
TestMode
...
...
StackExchange.Redis.Tests/MultiMaster.cs
View file @
67d23ca1
...
...
@@ -12,7 +12,7 @@ namespace StackExchange.Redis.Tests
public
class
MultiMaster
:
TestBase
{
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
SecurePort
+
","
+
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
+
",password="
+
TestConfig
.
Current
.
SecurePassword
;
TestConfig
.
Current
.
MasterServer
AndPort
+
","
+
TestConfig
.
Current
.
SecureServerAnd
Port
+
",password="
+
TestConfig
.
Current
.
SecurePassword
;
public
MultiMaster
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
...
...
@@ -39,8 +39,8 @@ public async Task DeslaveGoesToPrimary()
ConfigurationOptions
config
=
GetMasterSlaveConfig
();
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
config
))
{
var
primary
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
Master
Port
);
var
secondary
=
conn
.
GetServer
(
TestConfig
.
Current
.
SlaveServer
,
TestConfig
.
Current
.
Slave
Port
);
var
primary
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
And
Port
);
var
secondary
=
conn
.
GetServer
(
TestConfig
.
Current
.
SlaveServer
And
Port
);
primary
.
Ping
();
secondary
.
Ping
();
...
...
@@ -58,7 +58,7 @@ public async Task DeslaveGoesToPrimary()
conn
.
Configure
(
writer
);
string
log
=
writer
.
ToString
();
Assert
.
True
(
log
.
Contains
(
"tie-break is unanimous at "
+
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
),
"unanimous"
);
Assert
.
True
(
log
.
Contains
(
"tie-break is unanimous at "
+
TestConfig
.
Current
.
MasterServer
And
Port
),
"unanimous"
);
}
// k, so we know everyone loves 6379; is that what we get?
...
...
@@ -89,8 +89,8 @@ public async Task DeslaveGoesToPrimary()
// server topology changes from failures to recognize those changes
using
(
var
conn2
=
ConnectionMultiplexer
.
Connect
(
config
))
{
var
primary2
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
Master
Port
);
var
secondary2
=
conn
.
GetServer
(
TestConfig
.
Current
.
SlaveServer
,
TestConfig
.
Current
.
Slave
Port
);
var
primary2
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
And
Port
);
var
secondary2
=
conn
.
GetServer
(
TestConfig
.
Current
.
SlaveServer
And
Port
);
Writer
.
WriteLine
(
$"Check:
{
primary2
.
EndPoint
}
:
{
primary2
.
ServerType
}
, Mode:
{(
primary2
.
IsSlave
?
"Slave"
:
"Master"
)}
"
);
Writer
.
WriteLine
(
$"Check:
{
secondary2
.
EndPoint
}
:
{
secondary2
.
ServerType
}
, Mode:
{(
secondary2
.
IsSlave
?
"Slave"
:
"Master"
)}
"
);
...
...
@@ -143,15 +143,15 @@ public void TestMultiNoTieBreak()
public
static
IEnumerable
<
object
[
]>
GetConnections
()
{
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
MasterPort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
MasterPort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
SecurePort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
SecurePort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Secure
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
SecurePort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
,
null
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
MasterPort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Secure
Port
,
null
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
AndPort
,
TestConfig
.
Current
.
MasterServerAndPort
,
TestConfig
.
Current
.
MasterServerAnd
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
SecureServerAndPort
,
TestConfig
.
Current
.
SecureServerAndPort
,
TestConfig
.
Current
.
SecureServerAnd
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
SecureServerAndPort
,
TestConfig
.
Current
.
MasterServerAnd
Port
,
null
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
AndPort
,
TestConfig
.
Current
.
SecureServerAnd
Port
,
null
};
yield
return
new
object
[]
{
null
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
MasterPort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
MasterPort
,
null
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
};
yield
return
new
object
[]
{
null
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
SecurePort
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Secure
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
SecurePort
,
null
,
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Secure
Port
};
yield
return
new
object
[]
{
null
,
TestConfig
.
Current
.
MasterServer
AndPort
,
TestConfig
.
Current
.
MasterServerAnd
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
MasterServer
AndPort
,
null
,
TestConfig
.
Current
.
MasterServerAnd
Port
};
yield
return
new
object
[]
{
null
,
TestConfig
.
Current
.
SecureServerAndPort
,
TestConfig
.
Current
.
SecureServerAnd
Port
};
yield
return
new
object
[]
{
TestConfig
.
Current
.
SecureServerAndPort
,
null
,
TestConfig
.
Current
.
SecureServerAnd
Port
};
yield
return
new
object
[]
{
null
,
null
,
null
};
}
...
...
@@ -160,11 +160,11 @@ public void TestMultiWithTiebreak(string a, string b, string elected)
{
const
string
TieBreak
=
"__tie__"
;
// set the tie-breakers to the expected state
using
(
var
aConn
=
ConnectionMultiplexer
.
Connect
(
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Master
Port
))
using
(
var
aConn
=
ConnectionMultiplexer
.
Connect
(
TestConfig
.
Current
.
MasterServer
And
Port
))
{
aConn
.
GetDatabase
().
StringSet
(
TieBreak
,
a
);
}
using
(
var
aConn
=
ConnectionMultiplexer
.
Connect
(
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
Secure
Port
+
",password="
+
TestConfig
.
Current
.
SecurePassword
))
using
(
var
aConn
=
ConnectionMultiplexer
.
Connect
(
TestConfig
.
Current
.
SecureServerAnd
Port
+
",password="
+
TestConfig
.
Current
.
SecurePassword
))
{
aConn
.
GetDatabase
().
StringSet
(
TieBreak
,
b
);
}
...
...
StackExchange.Redis.Tests/PubSubNonParallel.cs
View file @
67d23ca1
using
System.IO
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Xunit
;
using
Xunit.Abstractions
;
...
...
@@ -13,7 +14,7 @@ public class PubSubNonParallel : TestBase
[
Theory
]
[
InlineData
(
false
)]
[
InlineData
(
true
)]
public
void
SubscriptionsSurviveMasterSwitch
(
bool
useSharedSocketManager
)
public
async
Task
SubscriptionsSurviveMasterSwitchAsync
(
bool
useSharedSocketManager
)
{
using
(
var
a
=
Create
(
allowAdmin
:
true
,
useSharedSocketManager
:
useSharedSocketManager
))
using
(
var
b
=
Create
(
allowAdmin
:
true
,
useSharedSocketManager
:
useSharedSocketManager
))
...
...
@@ -42,10 +43,10 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Interlocked
.
Increment
(
ref
bCount
);
});
Assert
.
False
(
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
).
IsSlave
,
TestConfig
.
Current
.
MasterPort
+
" is
master via a"
);
Assert
.
True
(
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
SlavePort
).
IsSlave
,
TestConfig
.
Current
.
SlavePort
+
" is
slave via a"
);
Assert
.
False
(
b
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
).
IsSlave
,
TestConfig
.
Current
.
MasterPort
+
" is
master via b"
);
Assert
.
True
(
b
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
SlavePort
).
IsSlave
,
TestConfig
.
Current
.
SlavePort
+
" is
slave via b"
);
Assert
.
False
(
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
MasterServerAndPort
}
should be
master via a"
);
Assert
.
True
(
a
.
GetServer
(
TestConfig
.
Current
.
SlaveServerAndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
SlaveServerAndPort
}
should be
slave via a"
);
Assert
.
False
(
b
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
MasterServerAndPort
}
should be
master via b"
);
Assert
.
True
(
b
.
GetServer
(
TestConfig
.
Current
.
SlaveServerAndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
SlaveServerAndPort
}
should be
slave via b"
);
var
epA
=
subA
.
SubscribedEndpoint
(
channel
);
var
epB
=
subB
.
SubscribedEndpoint
(
channel
);
...
...
@@ -68,18 +69,18 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Output
.
WriteLine
(
"Changing master..."
);
using
(
var
sw
=
new
StringWriter
())
{
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
Slave
Port
).
MakeMaster
(
ReplicationChangeOptions
.
All
,
sw
);
a
.
GetServer
(
TestConfig
.
Current
.
SlaveServerAnd
Port
).
MakeMaster
(
ReplicationChangeOptions
.
All
,
sw
);
Output
.
WriteLine
(
sw
.
ToString
());
}
subA
.
Ping
();
subB
.
Ping
();
Output
.
WriteLine
(
"Pausing..."
);
Thread
.
Sleep
(
2000
);
await
Task
.
Delay
(
4000
).
ForAwait
(
);
Assert
.
True
(
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
).
IsSlave
,
TestConfig
.
Current
.
MasterPort
+
" is
slave via a"
);
Assert
.
False
(
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
SlavePort
).
IsSlave
,
TestConfig
.
Current
.
SlavePort
+
" is
master via a"
);
Assert
.
True
(
b
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
).
IsSlave
,
TestConfig
.
Current
.
MasterPort
+
" is
slave via b"
);
Assert
.
False
(
b
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
SlavePort
).
IsSlave
,
TestConfig
.
Current
.
SlavePort
+
" is
master via b"
);
Assert
.
True
(
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
MasterServerAndPort
}
should be a
slave via a"
);
Assert
.
False
(
a
.
GetServer
(
TestConfig
.
Current
.
SlaveServerAndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
SlaveServerAndPort
}
should be a
master via a"
);
Assert
.
True
(
b
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
MasterServerAndPort
}
should be a
slave via b"
);
Assert
.
False
(
b
.
GetServer
(
TestConfig
.
Current
.
SlaveServerAndPort
).
IsSlave
,
$"
{
TestConfig
.
Current
.
SlaveServerAndPort
}
should be a
master via b"
);
Output
.
WriteLine
(
"Pause complete"
);
var
counters
=
a
.
GetCounters
();
...
...
@@ -88,6 +89,7 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Output
.
WriteLine
(
"b outstanding: "
+
counters
.
TotalOutstanding
);
subA
.
Ping
();
subB
.
Ping
();
await
Task
.
Delay
(
2000
).
ForAwait
();
epA
=
subA
.
SubscribedEndpoint
(
channel
);
epB
=
subB
.
SubscribedEndpoint
(
channel
);
Output
.
WriteLine
(
"a: "
+
EndPointCollection
.
ToString
(
epA
));
...
...
@@ -108,7 +110,7 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Output
.
WriteLine
(
"Restoring configuration..."
);
try
{
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
Master
Port
).
MakeMaster
(
ReplicationChangeOptions
.
All
);
a
.
GetServer
(
TestConfig
.
Current
.
MasterServer
And
Port
).
MakeMaster
(
ReplicationChangeOptions
.
All
);
}
catch
{
}
...
...
StackExchange.Redis.Tests/Scripting.cs
View file @
67d23ca1
...
...
@@ -44,7 +44,7 @@ public void CheckLoads(bool async)
Skip
.
IfMissingFeature
(
conn0
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
// note that these are on different connections (so we wouldn't expect
// the flush to drop the local cache - assume it is a surprise!)
var
server
=
conn0
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn0
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
var
db
=
conn1
.
GetDatabase
();
const
string
script
=
"return 1;"
;
...
...
@@ -102,7 +102,7 @@ public void CompareScriptToDirect()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
server
.
FlushAllDatabases
();
server
.
ScriptFlush
();
...
...
@@ -156,7 +156,7 @@ public void TestCallByHash()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
server
.
FlushAllDatabases
();
server
.
ScriptFlush
();
...
...
@@ -184,7 +184,7 @@ public void SimpleLuaScript()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
server
.
FlushAllDatabases
();
server
.
ScriptFlush
();
...
...
@@ -232,7 +232,7 @@ public void LuaScriptWithKeys()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
server
.
FlushAllDatabases
();
server
.
ScriptFlush
();
...
...
@@ -261,7 +261,7 @@ public void NoInlineReplacement()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
server
.
FlushAllDatabases
();
server
.
ScriptFlush
();
...
...
@@ -296,7 +296,7 @@ public void SimpleLoadedLuaScript()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
server
.
FlushAllDatabases
();
server
.
ScriptFlush
();
...
...
@@ -345,7 +345,7 @@ public void LoadedLuaScriptWithKeys()
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scripting
),
f
=>
f
.
Scripting
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
,
TestConfig
.
Current
.
MasterPort
);
var
server
=
conn
.
GetServer
(
TestConfig
.
Current
.
MasterServer
AndPort
);
server
.
FlushAllDatabases
();
server
.
ScriptFlush
();
...
...
StackExchange.Redis.Tests/Secure.cs
View file @
67d23ca1
...
...
@@ -10,7 +10,7 @@ namespace StackExchange.Redis.Tests
public
class
Secure
:
TestBase
{
protected
override
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
SecurePort
+
",password="
+
TestConfig
.
Current
.
SecurePassword
+
",name=MyClient"
;
TestConfig
.
Current
.
SecureServerAndPort
+
",password="
+
TestConfig
.
Current
.
SecurePassword
+
",name=MyClient"
;
public
Secure
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
...
...
StackExchange.Redis.Tests/TestBase.cs
View file @
67d23ca1
...
...
@@ -18,7 +18,7 @@ public abstract class TestBase : IDisposable
{
protected
ITestOutputHelper
Output
{
get
;
}
protected
TextWriterOutputHelper
Writer
{
get
;
}
protected
virtual
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
+
":"
+
TestConfig
.
Current
.
MasterPort
+
","
+
TestConfig
.
Current
.
SlaveServer
+
":"
+
TestConfig
.
Current
.
Slave
Port
;
protected
virtual
string
GetConfiguration
()
=>
TestConfig
.
Current
.
MasterServer
AndPort
+
","
+
TestConfig
.
Current
.
SlaveServerAnd
Port
;
protected
TestBase
(
ITestOutputHelper
output
)
{
...
...
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