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
fafb8cac
Commit
fafb8cac
authored
Jul 04, 2016
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Core: port MigratedBookSleeveTestSuite
parent
0b033a9f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
15 deletions
+126
-15
Massive Delete.cs
MigratedBookSleeveTestSuite/Issues/Massive Delete.cs
+2
-2
MigratedBookSleeveTestSuite.xproj
...atedBookSleeveTestSuite/MigratedBookSleeveTestSuite.xproj
+21
-0
Program.cs
MigratedBookSleeveTestSuite/Program.cs
+2
-0
PubSub.cs
MigratedBookSleeveTestSuite/PubSub.cs
+6
-6
project.json
MigratedBookSleeveTestSuite/project.json
+40
-0
redis-sharp.cs
MigratedBookSleeveTestSuite/redis-sharp.cs
+4
-4
StackExchange.Redis.Core.sln
StackExchange.Redis.Core.sln
+51
-3
No files found.
MigratedBookSleeveTestSuite/Issues/Massive Delete.cs
View file @
fafb8cac
...
...
@@ -41,7 +41,7 @@ public void ExecuteMassiveDelete()
var
originallyTask
=
conn
.
SetLengthAsync
(
todoKey
);
int
keepChecking
=
1
;
Task
last
=
null
;
while
(
Thread
.
Volatile
Read
(
ref
keepChecking
)
==
1
)
while
(
Volatile
.
Read
(
ref
keepChecking
)
==
1
)
{
throttle
.
Wait
();
// acquire
conn
.
SetPopAsync
(
todoKey
).
ContinueWith
(
task
=>
...
...
@@ -51,7 +51,7 @@ public void ExecuteMassiveDelete()
{
if
((
string
)
task
.
Result
==
null
)
{
Thread
.
Volatile
Write
(
ref
keepChecking
,
0
);
Volatile
.
Write
(
ref
keepChecking
,
0
);
}
else
{
...
...
MigratedBookSleeveTestSuite/MigratedBookSleeveTestSuite.xproj
0 → 100644
View file @
fafb8cac
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0.25420"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<VisualStudioVersion
Condition=
"'$(VisualStudioVersion)' == ''"
>
14.0.25420
</VisualStudioVersion>
<VSToolsPath
Condition=
"'$(VSToolsPath)' == ''"
>
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
</VSToolsPath>
</PropertyGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.Props"
Condition=
"'$(VSToolsPath)' != ''"
/>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
0fa2f7c5-1d36-40c4-82d1-93dbf43765d7
</ProjectGuid>
<RootNamespace>
MigratedBookSleeveTestSuite
</RootNamespace>
<BaseIntermediateOutputPath
Condition=
"'$(BaseIntermediateOutputPath)'=='' "
>
.\obj
</BaseIntermediateOutputPath>
<OutputPath
Condition=
"'$(OutputPath)'=='' "
>
.\bin\
</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service
Include=
"{82a7f48d-3b50-4b1e-b82e-3ada8210c358}"
/>
</ItemGroup>
<Import
Project=
"$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition=
"'$(VSToolsPath)' != ''"
/>
</Project>
\ No newline at end of file
MigratedBookSleeveTestSuite/Program.cs
View file @
fafb8cac
...
...
@@ -28,6 +28,7 @@ static void Main()
}
static
void
Main2
()
{
#if !CORE_CLR
// why is this here? because some dumbass forgot to install a decent test-runner before going to the airport
var
epicFail
=
new
List
<
string
>();
var
testTypes
=
from
type
in
typeof
(
Program
).
Assembly
.
GetTypes
()
...
...
@@ -163,6 +164,7 @@ where Attribute.IsDefined(method, typeof(TestAttribute))
// BookSleeve.RedisConnectionBase.AllSyncCallbacks, BookSleeve.RedisConnectionBase.AllAsyncCallbacks);
//#endif
#endif
}
}
}
...
...
MigratedBookSleeveTestSuite/PubSub.cs
View file @
fafb8cac
...
...
@@ -247,21 +247,21 @@ public void TestSubscribeUnsubscribeAndSubscribeAgain()
sub
.
WaitAll
(
t1
,
t2
);
pub
.
Publish
(
"abc"
,
""
);
AllowReasonableTimeToPublishAndProcess
();
Assert
.
AreEqual
(
1
,
Thread
.
Volatile
Read
(
ref
x
));
Assert
.
AreEqual
(
1
,
Thread
.
Volatile
Read
(
ref
y
));
Assert
.
AreEqual
(
1
,
Volatile
.
Read
(
ref
x
));
Assert
.
AreEqual
(
1
,
Volatile
.
Read
(
ref
y
));
t1
=
sub
.
UnsubscribeAsync
(
"abc"
,
null
);
t2
=
sub
.
UnsubscribeAsync
(
"ab*"
,
null
);
sub
.
WaitAll
(
t1
,
t2
);
pub
.
Publish
(
"abc"
,
""
);
Assert
.
AreEqual
(
1
,
Thread
.
Volatile
Read
(
ref
x
));
Assert
.
AreEqual
(
1
,
Thread
.
Volatile
Read
(
ref
y
));
Assert
.
AreEqual
(
1
,
Volatile
.
Read
(
ref
x
));
Assert
.
AreEqual
(
1
,
Volatile
.
Read
(
ref
y
));
t1
=
sub
.
SubscribeAsync
(
"abc"
,
delegate
{
Interlocked
.
Increment
(
ref
x
);
});
t2
=
sub
.
SubscribeAsync
(
"ab*"
,
delegate
{
Interlocked
.
Increment
(
ref
y
);
});
sub
.
WaitAll
(
t1
,
t2
);
pub
.
Publish
(
"abc"
,
""
);
AllowReasonableTimeToPublishAndProcess
();
Assert
.
AreEqual
(
2
,
Thread
.
Volatile
Read
(
ref
x
));
Assert
.
AreEqual
(
2
,
Thread
.
Volatile
Read
(
ref
y
));
Assert
.
AreEqual
(
2
,
Volatile
.
Read
(
ref
x
));
Assert
.
AreEqual
(
2
,
Volatile
.
Read
(
ref
y
));
}
}
...
...
MigratedBookSleeveTestSuite/project.json
0 → 100644
View file @
fafb8cac
{
"version"
:
"1.0.0-*"
,
"description"
:
"MigratedBookSleeveTestSuite"
,
"dependencies"
:
{
"StackExchange.Redis"
:
{
"version"
:
"1.1.*"
,
"target"
:
"project"
},
"nunit"
:
"3.4.1"
},
"testRunner"
:
"nunit"
,
"frameworks"
:
{
"net45"
:
{
},
"netcoreapp1.0"
:
{
"imports"
:
[
"portable-net45+win8"
],
"buildOptions"
:
{
"define"
:
[
"PLAT_SAFE_CONTINUATIONS"
,
"CORE_CLR"
]
},
"dependencies"
:
{
"Microsoft.NETCore.App"
:
{
"version"
:
"1.0.0-*"
,
"type"
:
"platform"
},
"System.Console"
:
"4.0.0"
,
"System.Diagnostics.Debug"
:
"4.0.11"
,
"System.Diagnostics.TraceSource"
:
"4.0.0"
,
"System.Linq.Expressions"
:
"4.1.0"
,
"System.Reflection.Extensions"
:
"4.0.1"
,
"System.Runtime.InteropServices"
:
"4.1.0"
,
"System.Threading.Tasks.Parallel"
:
"4.0.1"
,
"Microsoft.CSharp"
:
"4.0.1"
,
"dotnet-test-nunit"
:
"3.4.0-beta-1"
}
}
}
}
MigratedBookSleeveTestSuite/redis-sharp.cs
View file @
fafb8cac
...
...
@@ -238,7 +238,7 @@ void Connect()
socket
.
Connect
(
Host
,
Port
);
if
(!
socket
.
Connected
)
{
socket
.
Cl
ose
();
socket
.
Disp
ose
();
socket
=
null
;
return
;
}
...
...
@@ -272,7 +272,7 @@ bool SendDataCommand(byte[] data, string cmd, params object[] args)
catch
(
SocketException
)
{
// timeout;
socket
.
Cl
ose
();
socket
.
Disp
ose
();
socket
=
null
;
return
false
;
...
...
@@ -297,7 +297,7 @@ bool SendCommand(string cmd, params object[] args)
catch
(
SocketException
)
{
// timeout;
socket
.
Cl
ose
();
socket
.
Disp
ose
();
socket
=
null
;
return
false
;
...
...
@@ -842,7 +842,7 @@ protected virtual void Dispose(bool disposing)
if
(
disposing
)
{
SendCommand
(
"QUIT\r\n"
);
socket
.
Cl
ose
();
socket
.
Disp
ose
();
socket
=
null
;
}
}
...
...
StackExchange.Redis.Core.sln
View file @
fafb8cac
...
...
@@ -36,33 +36,81 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Redis Configs", "Redis Conf
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicTest", "BasicTest\BasicTest.xproj", "{939FA5F7-16AA-4847-812B-6EBC3748A86D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MigratedBookSleeveTestSuite", "MigratedBookSleeveTestSuite\MigratedBookSleeveTestSuite.xproj", "{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Docs", "Docs\Docs.csproj", "{7909952C-0F38-4E62-A7BA-1A77E1452FDA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Log Output|Any CPU = Log Output|Any CPU
Mono|Any CPU = Mono|Any CPU
Release|Any CPU = Release|Any CPU
Verbose|Any CPU = Verbose|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Log Output|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Mono|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Release|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Verbose|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Log Output|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Mono|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Release|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Verbose|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Log Output|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Mono|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Verbose|Any CPU.Build.0 = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Log Output|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Log Output|Any CPU.Build.0 = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Mono|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Mono|Any CPU.Build.0 = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Release|Any CPU.Build.0 = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Verbose|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Verbose|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Log Output|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Log Output|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Mono|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Mono|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Release|Any CPU.Build.0 = Release|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Verbose|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Verbose|Any CPU.Build.0 = Debug|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Log Output|Any CPU.ActiveCfg = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Log Output|Any CPU.Build.0 = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Mono|Any CPU.Build.0 = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Release|Any CPU.Build.0 = Release|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Verbose|Any CPU.ActiveCfg = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Verbose|Any CPU.Build.0 = Mono|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{96E891CD-2ED7-4293-A7AB-4C6F5D8D2B05} = {3AD17044-6BFF-4750-9AC2-2CA466375F2A}
EndGlobalSection
EndGlobal
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