Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
5c4b5fea
Commit
5c4b5fea
authored
Jun 09, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3d31d3c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
18 deletions
+26
-18
go/neo/connection_test.go
go/neo/connection_test.go
+9
-2
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+17
-16
No files found.
go/neo/connection_test.go
View file @
5c4b5fea
...
...
@@ -176,13 +176,20 @@ func nodeLinkPipe() (nl1, nl2 *NodeLink) {
// XXX temp for cluster_test.go
var
NodeLinkPipe
=
nodeLinkPipe
func
gox
(
wg
*
errgroup
.
Group
,
f
func
())
{
wg
.
Go
(
exc
.
Runx
(
f
))
}
func
TestNodeLink
(
t
*
testing
.
T
)
{
// TODO catch exception -> add proper location from it -> t.Fatal (see git-backup)
// Close vs recvPkt
nl1
,
nl2
:=
_nodeLinkPipe
(
linkNoRecvSend
,
linkNoRecvSend
)
wg
:=
WorkGroup
()
wg
.
Gox
(
func
()
{
//wg := WorkGroup()
//wg.Gox(func() {
wg
:=
&
errgroup
.
Group
{}
wg
:=
&
xsync
.
ErrGroup
{}
gox
(
wg
,
func
()
{
tdelay
()
xclose
(
nl1
)
})
...
...
go/neo/cluster_test.go
→
go/neo/
server/
cluster_test.go
View file @
5c4b5fea
...
...
@@ -15,22 +15,21 @@
//
// See COPYING file for full licensing terms.
package
neo_test
package
server
// test interaction between nodes
import
(
"bytes"
//
"bytes"
"context"
"io"
"reflect"
//
"io"
//
"reflect"
"testing"
.
"../neo"
"../neo/client"
"../neo/server"
"../../neo"
//"../../neo/client"
"
../zodb"
"../zodb/storage/fs1"
//"../
../zodb"
"../
../
zodb/storage/fs1"
"lab.nexedi.com/kirr/go123/exc"
)
...
...
@@ -49,14 +48,14 @@ func xfs1stor(path string) *fs1.FileStorage {
// M drives cluster with 1 S through recovery -> verification -> service -> shutdown
func
TestMasterStorage
(
t
*
testing
.
T
)
{
net
:=
NetPipe
(
""
)
// test network
net
:=
neo
.
NetPipe
(
""
)
// test network
Maddr
:=
"0"
Saddr
:=
"1"
M
:=
server
.
NewMaster
(
"abc1"
,
Maddr
,
net
)
M
:=
NewMaster
(
"abc1"
,
Maddr
,
net
)
zstor
:=
xfs1stor
(
"../zodb/storage/fs1/testdata/1.fs"
)
S
:=
server
.
NewStorage
(
"abc1"
,
Maddr
,
Saddr
,
net
,
zstor
)
S
:=
NewStorage
(
"abc1"
,
Maddr
,
Saddr
,
net
,
zstor
)
Mctx
,
Mcancel
:=
context
.
WithCancel
(
context
.
Background
())
Sctx
,
Scancel
:=
context
.
WithCancel
(
context
.
Background
())
...
...
@@ -64,7 +63,7 @@ func TestMasterStorage(t *testing.T) {
//Mev := M.subscribe(...)
wg
:=
WorkGroup
()
wg
:=
neo
.
WorkGroup
()
wg
.
Gox
(
func
()
{
err
:=
M
.
Run
(
Mctx
)
_
=
err
// XXX
...
...
@@ -88,14 +87,15 @@ func TestClientStorage(t *testing.T) {
// XXX temp disabled
return
/*
Cnl, Snl := NodeLinkPipe()
wg
:=
WorkGroup
()
wg :=
neo.
WorkGroup()
Sctx, Scancel := context.WithCancel(context.Background())
net
:=
NetPipe
(
""
)
// XXX here? (or a bit above?)
net :=
neo.
NetPipe("") // XXX here? (or a bit above?)
zstor := xfs1stor("../zodb/storage/fs1/testdata/1.fs") // XXX +readonly
S
:=
server
.
NewStorage
(
"cluster"
,
"Maddr"
,
"Saddr"
,
net
,
zstor
)
S := NewStorage("cluster", "Maddr", "Saddr", net, zstor)
wg.Gox(func() {
S.ServeLink(Sctx, Snl)
// XXX + test error return
...
...
@@ -174,4 +174,5 @@ func TestClientStorage(t *testing.T) {
Scancel()
xwait(wg)
*/
}
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