CB 4.5 flush intermittent error encounter with application test suite

I have CB 4.5 installed. When running my whole application test coverage, the Couchbase flush command gave me error intermittently. However, running individual test alone has no issue with cb flush. Is it some kind of memory/scalability issue? The error from the ruby gem is as below:

  Failure/Error: cb.flush if cb_flush
  
  TypeError:
    no implicit conversion of String into Integer
  # /.rvm/gems/ruby-2.2.4/gems/couchbase-1.3.15/lib/couchbase/view.rb:39:in `[]'

I checked CB server log and monitor the following logs when encountering errors above.

Service ‘goxdcr’ exited with status 1. Restarting. Messages: runtime.goexit()
/Users/jenkins/.cbdepscache/exploded/x86_64/go-1.5.2/go/src/runtime/asm_amd64.s:1721 +0x1 fp=0xc820210f90 sp=0xc820210f88
created by github.com/couchbase/goxdcr/supervisor.(*GenericSupervisor).sendHeartBeats
/Users/jenkins/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/goxdcr/supervisor/generic_supervisor.go:230 +0x815
[goport] 1969/12/31 19:00:00 /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/goxdcr terminated: exit status 2 ns_log 000 ns_1@127.0.0.1

Service ‘query’ exited with status 1. Restarting. Messages: runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20826dfb8 sp=0xc20826dfb0
created by github/couchbase/query/server/http.(*HttpEndpoint).Listen
/Users/jenkins/jenkins/workspace/watson-unix/goproj/src/github.com/couchbase/query/server/http/service_endpoint.go:71 +0x12a
[goport] 2017/07/28 12:30:17 /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/cbq-engine terminated: exit status 2

Any idea how to resolve this?

Thanks a lot!