|
|
@ -102,14 +102,6 @@ func TestStateStore_Txn_KVS(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
&structs.TxnOp{
|
|
|
|
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
|
|
|
|
Verb: structs.KVSGet,
|
|
|
|
|
|
|
|
DirEnt: structs.DirEntry{
|
|
|
|
|
|
|
|
Key: "not/there",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
&structs.TxnOp{
|
|
|
|
&structs.TxnOp{
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
Verb: structs.KVSCheckIndex,
|
|
|
|
Verb: structs.KVSCheckIndex,
|
|
|
@ -121,14 +113,6 @@ func TestStateStore_Txn_KVS(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
&structs.TxnOp{
|
|
|
|
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
|
|
|
|
Verb: structs.KVSGet,
|
|
|
|
|
|
|
|
DirEnt: structs.DirEntry{
|
|
|
|
|
|
|
|
Key: "foo/lock",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
&structs.TxnOp{
|
|
|
|
&structs.TxnOp{
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
Verb: structs.KVSLock,
|
|
|
|
Verb: structs.KVSLock,
|
|
|
@ -227,7 +211,6 @@ func TestStateStore_Txn_KVS(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
&structs.TxnResult{}, // get on not/there
|
|
|
|
|
|
|
|
&structs.TxnResult{
|
|
|
|
&structs.TxnResult{
|
|
|
|
KV: &structs.DirEntry{
|
|
|
|
KV: &structs.DirEntry{
|
|
|
|
Key: "foo/update",
|
|
|
|
Key: "foo/update",
|
|
|
@ -237,7 +220,6 @@ func TestStateStore_Txn_KVS(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
&structs.TxnResult{}, // get on foo/lock before it's created
|
|
|
|
|
|
|
|
&structs.TxnResult{
|
|
|
|
&structs.TxnResult{
|
|
|
|
KV: &structs.DirEntry{
|
|
|
|
KV: &structs.DirEntry{
|
|
|
|
Key: "foo/lock",
|
|
|
|
Key: "foo/lock",
|
|
|
@ -449,6 +431,14 @@ func TestStateStore_Txn_KVS_Rollback(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&structs.TxnOp{
|
|
|
|
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
|
|
|
|
Verb: structs.KVSGet,
|
|
|
|
|
|
|
|
DirEnt: structs.DirEntry{
|
|
|
|
|
|
|
|
Key: "nope",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
&structs.TxnOp{
|
|
|
|
&structs.TxnOp{
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
KV: &structs.TxnKVOp{
|
|
|
|
Verb: structs.KVSCheckSession,
|
|
|
|
Verb: structs.KVSCheckSession,
|
|
|
@ -505,6 +495,7 @@ func TestStateStore_Txn_KVS_Rollback(t *testing.T) {
|
|
|
|
"lock isn't held, or is held by another session",
|
|
|
|
"lock isn't held, or is held by another session",
|
|
|
|
"current session",
|
|
|
|
"current session",
|
|
|
|
`key "nope" doesn't exist`,
|
|
|
|
`key "nope" doesn't exist`,
|
|
|
|
|
|
|
|
`key "nope" doesn't exist`,
|
|
|
|
"current modify index",
|
|
|
|
"current modify index",
|
|
|
|
`key "nope" doesn't exist`,
|
|
|
|
`key "nope" doesn't exist`,
|
|
|
|
"unknown KV verb",
|
|
|
|
"unknown KV verb",
|
|
|
|