Commit 588abd65 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f0384a4c
......@@ -398,7 +398,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
// startNEOpy starts NEO/py server with database in workdir/
// and preloads it with data according to opt.Preload.
startNEOpy := func(t *testing.T, workdir string) *NEOPySrv {
startNEOpy := func(t *testing.T, workdir string, opt tOptions) *NEOPySrv {
X := xtesting.FatalIf(t)
neoOpt := neoOpt
......@@ -435,7 +435,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
inWorkDir(t, func(workdir string) {
X := xtesting.FatalIf(t)
npy := startNEOpy(t, workdir)
npy := startNEOpy(t, workdir, opt)
defer func() {
err := npy.Close(); X(err)
}()
......@@ -456,8 +456,20 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
// start NEO/py first. We need it to create the
// database and to preload it, because NEO/go
// does not currently support commit.
npy := startNEOpy(t, workdir)
npy := startNEOpy(t, workdir, opt)
err := npy.Close(); X(err)
// start NEO/py again to flush ttrans/tobj -> trans/obj tables
// if preload was requested. We need this because currently
// NEO/go does not implement recovery (which is write operation),
// and NEO/py leaves data after ZODB commit in ttrans/tobj (to
// be moved to trans/obj on next ZODB commit). See
// lab.nexedi.com/nexedi/neoppod/commit/7eb7cf1b
if opt.Preload != "" {
optRestart := opt
optRestart.Preload = ""
npy = startNEOpy(t, workdir, optRestart)
err = npy.Close(); X(err)
}
// start NEO/go, as the database is created and preloaded
ngo, err := StartNEOGoSrv(neoOpt); X(err)
......
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