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

go/*: Cosmetics

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