Commit 890290e6 authored by Kirill Smelkov's avatar Kirill Smelkov

go/*: Cosmetics

parent 25a8766b
......@@ -438,7 +438,7 @@ type Pong struct{}
type CloseClient struct {
}
// Ask node identier of the current primary master.
// Ask node identifier of the current primary master.
//
//neo:nodes ctl -> A
type PrimaryMaster struct {
......
......@@ -396,7 +396,7 @@ func (s *storage) _watcher() error {
func (s *storage) AddWatch(watchq chan<- Event) (at0 Tid) {
ack := make(chan Tid)
select {
// no longer operational: behave if watchq was registered before that
// no longer operational: behave as if watchq was registered before that
// and then seen down/close events. Interact with DelWatch directly.
case <-s.down:
s.headMu.Lock() // shutdown may be due to Close call and watcher might be
......
......@@ -108,6 +108,7 @@ func TestLoad(t *testing.T) {
}
// iterate tidMin..tidMax and expect db entries in expectv
// TODO -> xtesting
func testIterate(t *testing.T, fs *FileStorage, tidMin, tidMax zodb.Tid, expectv []dbEntry) {
ctx := context.Background()
iter := fs.Iterate(ctx, tidMin, tidMax)
......@@ -218,6 +219,7 @@ func testIterate(t *testing.T, fs *FileStorage, tidMin, tidMax zodb.Tid, expectv
}
}
// TODO -> xtesting
func TestIterate(t *testing.T) {
fs, _ := xfsopen(t, "testdata/1.fs")
defer exc.XRun(fs.Close)
......@@ -254,6 +256,7 @@ func TestIterate(t *testing.T) {
testIterate(t, fs, 0, zodb.TidMax, _1fs_dbEntryv[:])
}
// TODO -> xtesting
func BenchmarkIterate(b *testing.B) {
fs, _ := xfsopen(b, "testdata/1.fs")
defer exc.XRun(fs.Close)
......
......@@ -279,7 +279,7 @@ func (r rpc) call(ctx context.Context, argv ...interface{}) (interface{}, error)
// excError returns error corresponding to an exception.
//
// well-known exceptions are mapped to corresponding well-known errors - e.g.
// POSKeyError -> zodb.NoObjectError, and rest are returned wrapper into rpcExcept.
// POSKeyError -> zodb.NoObjectError, and rest are returned wrapped into rpcExcept.
func (r rpc) excError(exc string, argv tuple) error {
// translate well-known exceptions
switch exc {
......@@ -409,7 +409,7 @@ func (r rpc) ereplyf(format string, argv ...interface{}) *errorUnexpectedReply {
func openByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (_ zodb.IStorageDriver, at0 zodb.Tid, err error) {
url := u.String()
defer xerr.Contextf(&err, "open %s", url)
defer xerr.Contextf(&err, "zeo: open %s", url)
// zeo://host:port/path?storage=...&...
var net xnet.Networker
......
......@@ -34,7 +34,6 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb"
_ "lab.nexedi.com/kirr/neo/go/zodb/storage/fs1"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xnet"
)
......@@ -139,7 +138,7 @@ func (z *ZEOPySrv) Close() (err error) {
<-z.done
err = z.errExit
if _, ok := err.(*exec.ExitError); ok {
err = nil // ignore exit statue - it is always !0 on kill
err = nil // ignore exit status - it is always !0 on kill
}
return err
}
......@@ -154,6 +153,7 @@ func (z *ZEOPySrv) Encoding() encoding {
// ----------------
// tOptions represents options for testing.
// TODO -> xtesting
type tOptions struct {
Preload string // preload database with data from this location
}
......@@ -253,7 +253,7 @@ func TestEmptyDB(t *testing.T) {
}
func TestLoad(t *testing.T) {
X := exc.Raiseif
X := xtesting.FatalIf(t)
data := "../fs1/testdata/1.fs"
txnvOk, err := xtesting.LoadDBHistory(data); X(err)
......
// Copyright (C) 2016-2020 Nexedi SA and Contributors.
// Copyright (C) 2016-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
......@@ -327,7 +327,7 @@ type IStorage interface {
Loader
Iterator
// similar to IStorage
// similar to IStorageDriver
// Sync syncs to storage and updates current view of it.
//
......
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