nikepan / clickhouse-bulk

Collects many small inserts to ClickHouse and send in big inserts
Apache License 2.0
474 stars 87 forks source link

Add support for Go modules #10

Closed lenstr closed 5 years ago

lenstr commented 5 years ago

Go 1.11 introduced "modules". This feature is now experimental and will be finalized in Go 1.12.

codecov-io commented 5 years ago

Codecov Report

Merging #10 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #10   +/-   ##
=======================================
  Coverage   87.64%   87.64%           
=======================================
  Files           6        6           
  Lines         348      348           
=======================================
  Hits          305      305           
  Misses         32       32           
  Partials       11       11

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update abaa6ff...f42a1c9. Read the comment docs.

lenstr commented 5 years ago

Tests are failing because of another data race:

WARNING: DATA RACE
Write at 0x00c000086240 by goroutine 41:
  flag.(*stringValue).Set()
      /home/travis/.gimme/versions/go/src/flag/flag.go:231 +0x3a
  flag.(*FlagSet).parseOne()
      /home/travis/.gimme/versions/go/src/flag/flag.go:951 +0x539
  flag.(*FlagSet).Parse()
      /home/travis/.gimme/versions/go/src/flag/flag.go:970 +0x9a
  github.com/nikepan/clickhouse-bulk.main()
      /home/travis/.gimme/versions/go/src/flag/flag.go:998 +0x199
Previous read at 0x00c000086240 by main goroutine:
  [failed to restore the stack]
Goroutine 41 (running) created at:
  github.com/nikepan/clickhouse-bulk.TestRunServer()
      /home/travis/gopath/src/github.com/nikepan/clickhouse-bulk/server_test.go:45 +0xa12
  testing.tRunner()
      /home/travis/.gimme/versions/go/src/testing/testing.go:865 +0x163

There is also a problem with test coverage:

> go test -race -v -covermode=atomic -coverprofile=coverage.out
coverage: 90.1% of statements
> go test -race -v -covermode=atomic -coverprofile=coverage.out
coverage: 85.4% of statements
> go test -race -v -covermode=atomic -coverprofile=coverage.out
coverage: 79.9% of statements

Each time it produces different result.

Both problems are related to running go main() from tests and waiting 50ms. I suppose it should be rewritten in a more reliable way.

Since those problems are not related to the PR, they should be solved separately.