Commit 81b5056a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b311b5e0
...@@ -430,7 +430,7 @@ import ( ...@@ -430,7 +430,7 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"syscall" "syscall"
"time" // "time"
log "github.com/golang/glog" log "github.com/golang/glog"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
...@@ -818,12 +818,13 @@ retry: ...@@ -818,12 +818,13 @@ retry:
} }
fmt.Printf("\t- %s\t%s %v\n", file.zfile.POid(), size, blkv) fmt.Printf("\t- %s\t%s %v\n", file.zfile.POid(), size, blkv)
} }
time.Sleep(1*time.Second) //time.Sleep(1*time.Second)
fmt.Printf("\n\n") fmt.Printf("\n\n")
wg, ctx := errgroup.WithContext(context.TODO()) // XXX ctx = ? wg, ctx := errgroup.WithContext(context.TODO()) // XXX ctx = ?
for file, δfile := range δF.Change { for file, δfile := range δF.Change {
// XXX needed? // XXX needed?
// XXX even though δBtail is complete, not all ZBlk are present here
file.δtail.Append(δF.Rev, δfile.Blocks.Elements()) file.δtail.Append(δF.Rev, δfile.Blocks.Elements())
file := file file := file
......
...@@ -543,11 +543,14 @@ def test_wcfs(): ...@@ -543,11 +543,14 @@ def test_wcfs():
f.assertCache([0,0,0]) # initially not cached f.assertCache([0,0,0]) # initially not cached
f.assertData ([b'',b'',b'alpha'], mtime=t.head) f.assertData ([b'',b'',b'alpha'], mtime=t.head)
print('000')
# >>> (@at2) commit again -> we can see both latest and snapshotted states # >>> (@at2) commit again -> we can see both latest and snapshotted states
t.change(zf, {2: b'beta', 3: b'gamma'}) t.change(zf, {2: b'beta', 3: b'gamma'})
at2 = t.commit() at2 = t.commit()
t.wcsync() t.wcsync()
print('111')
# f @head # f @head
f.assertCache([1,1,0,0]) f.assertCache([1,1,0,0])
...@@ -560,11 +563,13 @@ def test_wcfs(): ...@@ -560,11 +563,13 @@ def test_wcfs():
# >>> (@at3) commit again without changing zf size # >>> (@at3) commit again without changing zf size
print('222')
f2 = t.open(zf, at=at2) f2 = t.open(zf, at=at2)
t.change(zf, {2: b'kitty'}) t.change(zf, {2: b'kitty'})
at3 = t.commit() at3 = t.commit()
t.wcsync() t.wcsync()
print('333')
f.assertCache([1,1,0,1]) f.assertCache([1,1,0,1])
# f @head is opened again -> cache must not be lost # f @head is opened again -> cache must not be lost
...@@ -597,7 +602,7 @@ def test_wcfs(): ...@@ -597,7 +602,7 @@ def test_wcfs():
# >>> XXX commit data to not yet accessed f part - nothing happens # >>> XXX commit data to not yet accessed f part - nothing happens
# XXX invalidation protocol ... # XXX invalidation protocol ...
print('\n\n') print('\n\n inv. protocol \n\n')
w = t.openwatch() w = t.openwatch()
done = chan() done = chan()
......
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