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
9bd894f0
Commit
9bd894f0
authored
Dec 30, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e0fff1ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
63 deletions
+4
-63
go/neo/neo_test.go
go/neo/neo_test.go
+4
-63
No files found.
go/neo/neo_test.go
View file @
9bd894f0
...
@@ -49,22 +49,19 @@ func TestMasterStorage(t *testing.T) {
...
@@ -49,22 +49,19 @@ func TestMasterStorage(t *testing.T) {
func
tracetestMasterStorage
(
t0
*
tracetest
.
T
)
{
func
tracetestMasterStorage
(
t0
*
tracetest
.
T
)
{
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
zstor
:=
xfs1stor
(
"../zodb/storage/fs1/testdata/1.fs"
)
zback
:=
xfs1back
(
"../zodb/storage/fs1/testdata/1.fs"
)
zback
:=
xfs1back
(
"../zodb/storage/fs1/testdata/1.fs"
)
zstor
:=
xfs1stor
(
"../zodb/storage/fs1/testdata/1.fs"
)
lastTid
,
err
:=
zstor
.
Sync
(
bg
);
X
(
err
)
// create the cluster
t
:=
tNewCluster_MS
(
t0
,
"abc1"
,
zback
)
t
:=
tNewCluster_MS
(
t0
,
"abc1"
,
zback
)
defer
t
.
Stop
()
defer
t
.
Stop
()
M
:=
t
.
Master
(
"m"
)
C
:=
t
.
NewClient
(
"c"
,
"m:1"
)
C
:=
t
.
NewClient
(
"c"
,
"m:1"
)
lastTid
,
err
:=
zstor
.
Sync
(
bg
);
X
(
err
)
tM
:=
t
.
Checker
(
"m"
)
tM
:=
t
.
Checker
(
"m"
)
// tS := t.Checker("s")
tC
:=
t
.
Checker
(
"c"
)
tC
:=
t
.
Checker
(
"c"
)
tMS
:=
t
.
Checker
(
"m-s"
)
tMS
:=
t
.
Checker
(
"m-s"
)
// tSM := t.Checker("s-m")
tCM
:=
t
.
Checker
(
"c-m"
)
tCM
:=
t
.
Checker
(
"c-m"
)
tMC
:=
t
.
Checker
(
"m-c"
)
tMC
:=
t
.
Checker
(
"m-c"
)
tCS
:=
t
.
Checker
(
"c-s"
)
tCS
:=
t
.
Checker
(
"c-s"
)
...
@@ -74,64 +71,8 @@ func tracetestMasterStorage(t0 *tracetest.T) {
...
@@ -74,64 +71,8 @@ func tracetestMasterStorage(t0 *tracetest.T) {
// TODO create C; C tries connect to master - rejected ("not yet operational")
// TODO create C; C tries connect to master - rejected ("not yet operational")
// TODO test ID rejects (uuid already registered, ...)
// TODO test ID rejects (uuid already registered, ...)
// XXX convert prologue to tNewCluster_MS
/*
// M starts listening
tM.Expect(netlisten("m:1"))
tM.Expect(δnode("m", "m:1", proto.MASTER, 1, proto.RUNNING, proto.IdTimeNone))
tM.Expect(clusterState("m", proto.ClusterRecovering))
// S starts listening
tS.Expect(netlisten("s:1"))
// S connects M
tSM.Expect(netdial("s", "m:1"))
tSM.Expect(netconnect("s:2", "m:2", "m:1"))
tSM.Expect(conntx("s:2", "m:2", 1, &proto.RequestIdentification{
NodeType: proto.STORAGE,
UUID: 0,
Address: xnaddr("s:1"),
ClusterName: "abc1",
IdTime: proto.IdTimeNone,
DevPath: nil,
NewNID: nil,
}))
tM.Expect(δnode("m", "s:1", proto.STORAGE, 1, proto.PENDING, 0.01))
tSM.Expect(conntx("m:2", "s:2", 1, &proto.AcceptIdentification{
NodeType: proto.MASTER,
MyUUID: proto.UUID(proto.MASTER, 1),
YourUUID: proto.UUID(proto.STORAGE, 1),
}))
// M starts recovery on S
tMS.Expect(conntx("m:2", "s:2", 0, &proto.Recovery{}))
tMS.Expect(conntx("s:2", "m:2", 0, &proto.AnswerRecovery{
// empty new node
PTid: 0,
BackupTid: proto.INVALID_TID,
TruncateTid: proto.INVALID_TID,
}))
tMS.Expect(conntx("m:2", "s:2", 2, &proto.AskPartitionTable{}))
tMS.Expect(conntx("s:2", "m:2", 2, &proto.AnswerPartitionTable{
PTid: 0,
NumReplicas: 0,
RowList: []proto.RowInfo{},
}))
// M ready to start: new cluster, no in-progress S recovery
tM.Expect(masterStartReady("m", true))
// ----------------------------------------
*/
// M <- start cmd
// M <- start cmd
M
:=
t
.
Master
(
"m"
)
wg
:=
xsync
.
NewWorkGroup
(
bg
)
wg
:=
xsync
.
NewWorkGroup
(
bg
)
gox
(
wg
,
func
(
ctx
context
.
Context
)
{
gox
(
wg
,
func
(
ctx
context
.
Context
)
{
err
:=
M
.
Start
();
X
(
err
)
err
:=
M
.
Start
();
X
(
err
)
...
...
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