Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/ci small things #1153

Merged
merged 4 commits into from
Oct 19, 2023
Merged

fix/ci small things #1153

merged 4 commits into from
Oct 19, 2023

Conversation

altergui
Copy link
Contributor

  • test: allow setting chainID and height, useful to test soft-forks
  • test: AdvanceTestBlocksUntilHeight method
  • deepsource: enable test-coverage and other analyzers

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6549290779

  • 8 of 25 (32.0%) changed or added relevant lines in 2 files are covered.
  • 11 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.04%) to 62.339%

Changes Missing Coverage Covered Lines Changed/Added Lines %
vochain/apptest.go 4 21 19.05%
Files with Coverage Reduction New Missed Lines %
api/accounts.go 2 48.79%
apiclient/account.go 2 48.45%
vochain/transaction/admin_tx.go 2 50.0%
vochain/transaction/transaction.go 2 65.59%
cmd/end2endtest/account.go 3 68.57%
Totals Coverage Status
Change from base Build 6536080741: -0.04%
Covered Lines: 14174
Relevant Lines: 22737

💛 - Coveralls

@altergui altergui force-pushed the fix/ci-small-things branch from f1e1dc3 to 9fd73a0 Compare October 17, 2023 16:29
@altergui altergui marked this pull request as ready for review October 17, 2023 16:32
@altergui altergui marked this pull request as draft October 17, 2023 16:43
@altergui
Copy link
Contributor Author

TestAddVote sometimes hits a race, maaaaybe because of reducing time.Sleep in AdvanceTestBlock. i'll debug this further.

==================
WARNING: DATA RACE
Write at 0x00c0007bc038 by goroutine 658:
  github.com/cockroachdb/pebble.newIndexedBatch()
      /home/runner/go/pkg/mod/github.com/cockroachdb/pebble@v0.0.0-20230620232302-06034ff014e0/batch.go:371 +0x1a4
  github.com/cockroachdb/pebble.(*DB).NewIndexedBatch()
      /home/runner/go/pkg/mod/github.com/cockroachdb/pebble@v0.0.0-20230620232302-06034ff014e0/db.go:1424 +0xc4
  go.vocdoni.io/dvote/db/pebbledb.(*PebbleDB).WriteTx()
      /home/runner/work/vocdoni-node/vocdoni-node/db/pebbledb/pebledb.go:138 +0x6a
  go.vocdoni.io/dvote/statedb.(*StateDB).BeginTx()
      /home/runner/work/vocdoni-node/vocdoni-node/statedb/statedb.go:301 +0x10f
  go.vocdoni.io/dvote/vochain/state.initStateDB()
      /home/runner/work/vocdoni-node/vocdoni-node/vochain/state/state.go:168 +0x451
  go.vocdoni.io/dvote/vochain/state.NewState()
      /home/runner/work/vocdoni-node/vocdoni-node/vochain/state/state.go:106 +0x14a
  go.vocdoni.io/dvote/test/testcommon.NewVochainState()
      /home/runner/work/vocdoni-node/vocdoni-node/test/testcommon/vochain.go:86 +0x94
  go.vocdoni.io/dvote/test/testcommon.NewVochainStateWithProcess()
      /home/runner/work/vocdoni-node/vocdoni-node/test/testcommon/vochain.go:129 +0x79
  go.vocdoni.io/dvote/test.TestAddVote()
      /home/runner/work/vocdoni-node/vocdoni-node/test/statedb_test.go:93 +0x44
  testing.tRunner()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1595 +0x238
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1648 +0x44
Previous read at 0x00c0007bc038 by goroutine 661:
  github.com/cockroachdb/pebble.(*Batch).release()
      /home/runner/go/pkg/mod/github.com/cockroachdb/pebble@v0.0.0-20230620232302-06034ff014e0/batch.go:388 +0x3c
  github.com/cockroachdb/pebble.(*Batch).Close()
      /home/runner/go/pkg/mod/github.com/cockroachdb/pebble@v0.0.0-20230620232302-06034ff014e0/batch.go:1283 +0x70
  go.vocdoni.io/dvote/db/pebbledb.WriteTx.Discard()
      /home/runner/work/vocdoni-node/vocdoni-node/db/pebbledb/pebledb.go:96 +0xe
  go.vocdoni.io/dvote/db/prefixeddb.(*PrefixedWriteTx).Discard()
      /home/runner/work/vocdoni-node/vocdoni-node/db/prefixeddb/prefixeddb.go:129 +0x9c
  go.vocdoni.io/dvote/vochain/state.(*State).Close()
      /home/runner/work/vocdoni-node/vocdoni-node/vochain/state/state.go:470 +0x183
  go.vocdoni.io/dvote/test/testcommon.NewVochainState.func1()
      /home/runner/work/vocdoni-node/vocdoni-node/test/testcommon/vochain.go:90 +0x44
  testing.(*common).Cleanup.func1()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1169 +0x182
  testing.(*common).runCleanup()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1347 +0x1c2
  testing.tRunner.func2()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1589 +0x50
  runtime.deferreturn()
      /opt/hostedtoolcache/go/1.21.1/x64/src/runtime/panic.go:477 +0x30
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1648 +0x44
Goroutine 658 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1648 +0x82a
  testing.runTests.func1()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:2054 +0x84
  testing.tRunner()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1595 +0x238
  testing.runTests()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:2052 +0x896
  testing.(*M).Run()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1925 +0xb57
  main.main()
      _testmain.go:105 +0x2e4
Goroutine 661 (finished) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1648 +0x82a
  testing.runTests.func1()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:2054 +0x84
  testing.tRunner()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1595 +0x238
  testing.runTests()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:2052 +0x896
  testing.(*M).Run()
      /opt/hostedtoolcache/go/1.21.1/x64/src/testing/testing.go:1925 +0xb57
  main.main()
      _testmain.go:105 +0x2e4
==================
--- FAIL: TestAddVote (0.02s)
    testing.go:1465: race detected during execution of test

@altergui
Copy link
Contributor Author

...or maybe i just reproduced #1139 which would make me happy

@altergui altergui self-assigned this Oct 18, 2023
@altergui altergui marked this pull request as ready for review October 18, 2023 11:06
@altergui
Copy link
Contributor Author

the CI failure is definitely unrelated, so this PR is ready to approve/merge

@altergui altergui requested a review from mariajdab October 18, 2023 11:06
@p4u p4u merged commit 0e8e00e into main Oct 19, 2023
12 checks passed
@p4u p4u deleted the fix/ci-small-things branch October 19, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants