"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "nsqlookupd/lookup_protocol_v1_test.go" between
nsq-1.2.0.tar.gz and nsq-1.2.1.tar.gz

About: nsq is a realtime distributed and and decentralized messaging platform.

lookup_protocol_v1_test.go  (nsq-1.2.0):lookup_protocol_v1_test.go  (nsq-1.2.1)
skipping to change at line 41 skipping to change at line 41
fakeConn.ReadFunc = func(b []byte) (int, error) { fakeConn.ReadFunc = func(b []byte) (int, error) {
return copy(b, []byte("INVALID_COMMAND\n")), nil return copy(b, []byte("INVALID_COMMAND\n")), nil
} }
opts := NewOptions() opts := NewOptions()
opts.Logger = test.NewTestLogger(t) opts.Logger = test.NewTestLogger(t)
opts.LogLevel = LOG_DEBUG opts.LogLevel = LOG_DEBUG
nsqlookupd, err := New(opts) nsqlookupd, err := New(opts)
test.Nil(t, err) test.Nil(t, err)
prot := &LookupProtocolV1{ctx: &Context{nsqlookupd: nsqlookupd}} prot := &LookupProtocolV1{nsqlookupd: nsqlookupd}
nsqlookupd.tcpServer = &tcpServer{nsqlookupd: prot.nsqlookupd}
errChan := make(chan error) errChan := make(chan error)
testIOLoop := func() { testIOLoop := func() {
errChan <- prot.IOLoop(fakeConn) client := prot.NewClient(fakeConn)
defer prot.ctx.nsqlookupd.Exit() errChan <- prot.IOLoop(client)
defer prot.nsqlookupd.Exit()
} }
go testIOLoop() go testIOLoop()
var timeout bool var timeout bool
select { select {
case err = <-errChan: case err = <-errChan:
case <-time.After(2 * time.Second): case <-time.After(2 * time.Second):
timeout = true timeout = true
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)