Commit 2374d598 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 86237665
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
// See COPYING file for full licensing terms. // See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options. // See https://www.nexedi.com/licensing for rationale and options.
// Package xbtreetest/init (ex imported from package A) should be imported in // Package xbtreetest/init (ex imported from package A_test) should be imported
// addition to xbtreetest (from package A_test) to initialize xbtreetest at runtime. // in addition to xbtreetest (ex imported from package A) to initialize
// xbtreetest at runtime.
package init package init
// ZBlk-related part of δbtail_test // ZBlk-related part of δbtail_test
......
...@@ -25,7 +25,7 @@ package zdata ...@@ -25,7 +25,7 @@ package zdata
// and queries. // and queries.
// //
// We assume that ΔBtail works correctly (this is covered by ΔBtail tests) // We assume that ΔBtail works correctly (this is covered by ΔBtail tests)
// -> no need to exercise many different topologies and tracking sets. // -> no need to exercise many different topologies and tracking sets here.
// //
// Since ΔFtail does not recompute anything by itself when tracking set // Since ΔFtail does not recompute anything by itself when tracking set
// changes, and only merges δBtail and δZtail histories on queries, there is no // changes, and only merges δBtail and δZtail histories on queries, there is no
...@@ -67,7 +67,7 @@ const ø = "ø" ...@@ -67,7 +67,7 @@ const ø = "ø"
// ΔFTestEntry represents one entry in ΔFtail tests. // ΔFTestEntry represents one entry in ΔFtail tests.
type ΔFTestEntry struct { type ΔFTestEntry struct {
δblkTab map[int64]string // changes in tree part {} #blk -> ZBlk<name> δblkTab map[int64]string // changes in tree part {} #blk -> ZBlk<name>
δdataTab setStr // changes to ZBlk objects δdataTab setStr // changes to ZBlk objects {ZBlk<name>}
} }
// TestΔFtail runs ΔFtail tests on set of concrete prepared testcases. // TestΔFtail runs ΔFtail tests on set of concrete prepared testcases.
...@@ -100,14 +100,14 @@ func TestΔFtail(t *testing.T) { ...@@ -100,14 +100,14 @@ func TestΔFtail(t *testing.T) {
{δT{5:e}, δD()}, {δT{5:e}, δD()},
{δT{}, δD(i)}, {δT{}, δD(i)},
// XXX text // delete the file
{nil, nil}, {nil, nil},
// ---- found by TestΔFtailRandom ---- // ---- found by TestΔFtailRandom ----
{δT{1:a,6:i,7:d,8:e}, δD(a,c,e,f,g,h,i,j)}, {δT{1:a,6:i,7:d,8:e}, δD(a,c,e,f,g,h,i,j)},
// was including <= lo entries in SliceByFileRev // was including lo entries in SliceByFileRev
{δT{0:b,2:j,3:i,5:f,6:b,7:i,8:d}, δD(a,b,c,d,e,g,i,j)}, {δT{0:b,2:j,3:i,5:f,6:b,7:i,8:d}, δD(a,b,c,d,e,g,i,j)},
{δT{0:e,2:h,4:d,9:b}, δD(a,h,i)}, {δT{0:e,2:h,4:d,9:b}, δD(a,h,i)},
{δT{0:j,1:i,3:g,5:a,6:e,7:j,8:f,9:d}, δD()}, {δT{0:j,1:i,3:g,5:a,6:e,7:j,8:f,9:d}, δD()},
...@@ -116,7 +116,7 @@ func TestΔFtail(t *testing.T) { ...@@ -116,7 +116,7 @@ func TestΔFtail(t *testing.T) {
{δT{0:i,1:f,4:e,5:e,7:d,8:h}, δD(d,j)}, {δT{0:i,1:f,4:e,5:e,7:d,8:h}, δD(d,j)},
{δT{}, δD(a,b,c,e,f,g,h,i,j)}, {δT{}, δD(a,b,c,e,f,g,h,i,j)},
// XXX // 0 was missing in δf
{nil, nil}, {nil, nil},
{δT{0:a}, δD()}, {δT{0:a}, δD()},
{δT{2:i,3:c,5:d,9:c}, δD(a,b,c,d,e,f,g,h,i)}, {δT{2:i,3:c,5:d,9:c}, δD(a,b,c,d,e,f,g,h,i)},
...@@ -186,7 +186,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -186,7 +186,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
xat := map[zodb.Tid]string{} // tid -> "at<i>" xat := map[zodb.Tid]string{} // tid -> "at<i>"
// data built via applying changes from testv // data built via applying changes from testq
vδf := []*ΔFile{} // (rev↑, {}blk) vδf := []*ΔFile{} // (rev↑, {}blk)
vδE := []_ΔFileEpoch{} // (rev↑, EPOCH) vδE := []_ΔFileEpoch{} // (rev↑, EPOCH)
blkTab := map[int64]string{} // #blk -> ZBlk<name> blkTab := map[int64]string{} // #blk -> ZBlk<name>
...@@ -304,7 +304,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -304,7 +304,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
δtree := false δtree := false
delfile := false delfile := false
// command to delete zfile // {nil,nil} commands to delete zfile
if test.δblkTab == nil && test.δdataTab == nil { if test.δblkTab == nil && test.δdataTab == nil {
delfile = true delfile = true
} }
...@@ -373,9 +373,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -373,9 +373,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if delfile { if delfile {
req = "øf" req = "øf"
} else { } else {
tTxt := "t" + xbtreetest.KVTxt(blkTab) req = fmt.Sprintf("t%s D%s", xbtreetest.KVTxt(blkTab), dataTabTxt(dataTab))
dTxt := "D" + dataTabTxt(dataTab)
req = tTxt + " " + dTxt
} }
commit := t.CommitTree(req) commit := t.CommitTree(req)
if newEpoch { if newEpoch {
...@@ -407,7 +405,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -407,7 +405,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
blkRev[blk] = commit.At blkRev[blk] = commit.At
} }
blkRevAt[commit.At] = blkRev blkRevAt[commit.At] = blkRev
if false { /*
fmt.Printf("blkRevAt[@%s]:\n", xat[commit.At]) fmt.Printf("blkRevAt[@%s]:\n", xat[commit.At])
blkv := []int64{} blkv := []int64{}
for blk := range blkRev { for blk := range blkRev {
...@@ -419,7 +417,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -419,7 +417,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
for _, blk := range blkv { for _, blk := range blkv {
fmt.Printf(" #%d: %v\n", blk, blkRev[blk]) fmt.Printf(" #%d: %v\n", blk, blkRev[blk])
} }
} */
// update zfile // update zfile
txn.Abort() txn.Abort()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment