Commit 21705f0f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9d13ca2c
...@@ -355,17 +355,7 @@ func BenchmarkIterate(b *testing.B) { ...@@ -355,17 +355,7 @@ func BenchmarkIterate(b *testing.B) {
b.StopTimer() b.StopTimer()
} }
// // XXX kill // TestWatch verifies that watcher can observes commits done from outside.
// var tracef = func(format string, argv ...interface{}) {
// log.Printf("W " + format, argv...)
// }
//
// func init() {
// log.SetFlags(log.Lmicroseconds)
// }
func TestWatch(t *testing.T) { func TestWatch(t *testing.T) {
X := exc.Raiseif X := exc.Raiseif
...@@ -412,8 +402,6 @@ func TestWatch(t *testing.T) { ...@@ -412,8 +402,6 @@ func TestWatch(t *testing.T) {
} }
xcommit := func(at zodb.Tid, objv ...Object) zodb.Tid { xcommit := func(at zodb.Tid, objv ...Object) zodb.Tid {
//tracef("-> xcommit %s", at)
//defer tracef("<- xcommit")
t.Helper() t.Helper()
tid, err := zcommit(at, objv...); X(err) tid, err := zcommit(at, objv...); X(err)
return tid return tid
...@@ -500,8 +488,11 @@ func TestOpenRecovery(t *testing.T) { ...@@ -500,8 +488,11 @@ func TestOpenRecovery(t *testing.T) {
} }
// if txn header can be fully read - it should be all ok // if txn header can be fully read - it should be all ok
// XXX also test +0? lok := []int{0}
for l := len(voteTail); l >= TxnHeaderFixSize; l-- { for l := len(voteTail); l >= TxnHeaderFixSize; l-- {
lok = append(lok, l)
}
for _, l := range lok {
checkL(t, l, func(t *testing.T, tfs string) { checkL(t, l, func(t *testing.T, tfs string) {
fs := xfsopen(t, tfs) fs := xfsopen(t, tfs)
head, err := fs.LastTid(ctx); X(err) head, err := fs.LastTid(ctx); X(err)
...@@ -513,7 +504,8 @@ func TestOpenRecovery(t *testing.T) { ...@@ -513,7 +504,8 @@ func TestOpenRecovery(t *testing.T) {
}) })
} }
// if txn header is not complete - open should fail // if txn header is stably incomplete - open should fail
// XXX better check 0..sizeof(txnh)-1 but in this range each check is slow.
for _, l := range []int{TxnHeaderFixSize-1,1} { for _, l := range []int{TxnHeaderFixSize-1,1} {
checkL(t, l, func(t *testing.T, tfs string) { checkL(t, l, func(t *testing.T, tfs string) {
_, err := Open(ctx, tfs, &zodb.DriverOptions{ReadOnly: true}) _, err := Open(ctx, tfs, &zodb.DriverOptions{ReadOnly: true})
......
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