Commit abcec3cb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6a43ce9b
...@@ -68,7 +68,7 @@ func (d *Storage) Sync(ctx context.Context) (head zodb.Tid, err error) { ...@@ -68,7 +68,7 @@ func (d *Storage) Sync(ctx context.Context) (head zodb.Tid, err error) {
} }
}() }()
head, err := d.δ.Sync(ctx) head, err = d.δ.Sync(ctx)
if err != nil { if err != nil {
return zodb.InvalidTid, err return zodb.InvalidTid, err
} }
......
...@@ -170,7 +170,25 @@ func TestWatch(t *testing.T) { ...@@ -170,7 +170,25 @@ func TestWatch(t *testing.T) {
} }
// TODO change base -> demo shutdown // TestBaseMutate verifies that demo detect if base mutates.
func TestBaseMutate(t *testing.T) {
withDemo(t, func(t *testing.T, ddat *DemoData, ddrv *Storage) {
X := xtesting.FatalIf(t)
head, err := ddrv.Sync(context.Background())
if !(head == 0 && err == nil) {
t.Fatalf("sync0: head=%s err=%s", head, err)
}
_, err = xtesting.ZPyCommitRaw(ddat.base, 0, xtesting.ZRawObject{
Oid: 1,
Data: []byte("ZZZ"),
}); X(err)
head, err = ddrv.Sync(context.Background())
// XXX verify err
})
}
func demoOpen(zurl string, opt *zodb.DriverOptions) (_ *Storage, at0 zodb.Tid, err error) { func demoOpen(zurl string, opt *zodb.DriverOptions) (_ *Storage, at0 zodb.Tid, err error) {
defer xerr.Contextf(&err, "opendemo %s", zurl) defer xerr.Contextf(&err, "opendemo %s", zurl)
......
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