Commit 523298bc authored by Kirill Smelkov's avatar Kirill Smelkov

go/internal/xtesting: DrvTestLoad: Verify load of non-existing and not-yet-created objects

This currently fails on ZEO and NEO. Those storages will be fixed in the
following patches.
parent eb8d8682
......@@ -298,9 +298,12 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn, bugv ...s
// ~ loadBefore
xid = zodb.Xid{txh.Tid - 1, obj.Oid}
expect, ok := before[obj.Oid]
if ok {
expect, exists := before[obj.Oid]
if exists {
checkLoad(t, zdrv, xid, expect, bugs)
} else {
// verify load of not-yet-created object
checkLoad(t, zdrv, xid, objState{0, nil}, bugs)
}
before[obj.Oid] = objState{txh.Tid, obj.Data}
......@@ -315,8 +318,17 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn, bugv ...s
checkLoad(t, zdrv, xid, expect, bugs)
}
// XXX verify load of non-existing object
// XXX verify load of not-yet-created object
// verify load of non-existing object
var oid zodb.Oid
for oid = 0;; oid++ {
_, exists := before[oid]
if !exists {
break
}
}
xid := zodb.Xid{zodb.TidMax, oid} // XXX TidMax -> head
bugs["load:noserial-after-deleted"] = true // force NoObjectError
checkLoad(t, zdrv, xid, objState{0, nil}, bugs)
}
// DrvTestWatch verifies that storage driver watcher can observe commits done from outside.
......
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