Commit 4acadb94 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 (NEO only on @t branch for now).
parent d8b51133
...@@ -283,9 +283,12 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn, bugv ...s ...@@ -283,9 +283,12 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn, bugv ...s
// ~ loadBefore // ~ loadBefore
xid = zodb.Xid{txh.Tid - 1, obj.Oid} xid = zodb.Xid{txh.Tid - 1, obj.Oid}
expect, ok := before[obj.Oid] expect, exists := before[obj.Oid]
if ok { if exists {
checkLoad(t, zdrv, xid, expect, bugs) 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} before[obj.Oid] = objState{txh.Tid, obj.Data}
...@@ -299,6 +302,18 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn, bugv ...s ...@@ -299,6 +302,18 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn, bugv ...s
xid := zodb.Xid{zodb.TidMax, oid} xid := zodb.Xid{zodb.TidMax, oid}
checkLoad(t, zdrv, xid, expect, bugs) checkLoad(t, zdrv, xid, expect, bugs)
} }
// 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. // 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