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

core/services/fluxmonitorv2: fix TestFluxMonitor_Deviation race #15344

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Nov 20, 2024

Go-ethereum mutates *big.Ints passed to ABI bindings for some reason. This may be a bug/oversight, but in any case leads to a race between tests:

Race:
==================
WARNING: DATA RACE
Read at 0x00c0010982c0 by goroutine 344:
  reflect.Value.Bool()
      /opt/hostedtoolcache/go/1.23.3/x64/src/reflect/value.go:283 +0x493
  reflect.deepValueEqual()
      /opt/hostedtoolcache/go/1.23.3/x64/src/reflect/deepequal.go:167 +0x494
  reflect.deepValueEqual()
      /opt/hostedtoolcache/go/1.23.3/x64/src/reflect/deepequal.go:130 +0x1dfb
  reflect.deepValueEqual()
      /opt/hostedtoolcache/go/1.23.3/x64/src/reflect/deepequal.go:127 +0x1689
  reflect.DeepEqual()
      /opt/hostedtoolcache/go/1.23.3/x64/src/reflect/deepequal.go:238 +0x244
  github.com/stretchr/testify/assert.ObjectsAreEqual()
      /home/runner/go/pkg/mod/github.com/stretchr/testify@v1.9.0/assert/assertions.go:65 +0x[17](https://github.com/smartcontractkit/chainlink/actions/runs/11940570982/job/33283529603#step:19:18)2
  github.com/stretchr/testify/assert.Equal()
      /home/runner/go/pkg/mod/github.com/stretchr/testify@v1.9.0/assert/assertions.go:463 +0x237
  github.com/stretchr/testify/require.Equal()
      /home/runner/go/pkg/mod/github.com/stretchr/testify@v1.9.0/require/require.go:159 +0xe7
  github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2_test.setupFluxAggregatorUniverse()
      /home/runner/work/chainlink/chainlink/core/services/fluxmonitorv2/integrations_test.go:175 +0x1407
  github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2_test.TestFluxMonitor_Deviation.func1()
      /home/runner/work/chainlink/chainlink/core/services/fluxmonitorv2/integrations_test.go:445 +0x7a
  testing.tRunner()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1690 +0x226
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1743 +0x44

Previous write at 0x00c0010982c0 by goroutine 343:
  math/big.(*Int).And()
      /opt/hostedtoolcache/go/1.23.3/x64/src/math/big/int.go:1[18](https://github.com/smartcontractkit/chainlink/actions/runs/11940570982/job/33283529603#step:19:19)4 +0x4ce
  github.com/ethereum/go-ethereum/common/math.U256()
      /home/runner/go/pkg/mod/github.com/ethereum/go-ethereum@v1.14.11/common/math/big.go:229 +0x3c
  github.com/ethereum/go-ethereum/common/math.U256Bytes()
      /home/runner/go/pkg/mod/github.com/ethereum/go-ethereum@v1.14.11/common/math/big.go:235 +0xe
  github.com/ethereum/go-ethereum/accounts/abi.MakeTopics()
      /home/runner/go/pkg/mod/github.com/ethereum/go-ethereum@v1.14.11/accounts/abi/topics.go:45 +0xbcc
  github.com/ethereum/go-ethereum/accounts/abi/bind.(*BoundContract).FilterLogs()
      /home/runner/go/pkg/mod/github.com/ethereum/go-ethereum@v1.14.11/accounts/abi/bind/base.go:444 +0x29b
  github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper.(*FluxAggregatorFilterer).FilterAvailableFundsUpdated()
      /home/runner/work/chainlink/chainlink/core/gethwrappers/generated/flux_aggregator_wrapper/flux_aggregator_wrapper.go:1181 +0x[20](https://github.com/smartcontractkit/chainlink/actions/runs/11940570982/job/33283529603#step:19:21)7
  github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2_test.setupFluxAggregatorUniverse()
      /home/runner/work/chainlink/chainlink/core/services/fluxmonitorv2/integrations_test.go:177 +0x147b
  github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2_test.TestFluxMonitor_Deviation.func1()
      /home/runner/work/chainlink/chainlink/core/services/fluxmonitorv2/integrations_test.go:445 +0x7a
  testing.tRunner()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1690 +0x[22](https://github.com/smartcontractkit/chainlink/actions/runs/11940570982/job/33283529603#step:19:23)6
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1743 +0x44

Goroutine 344 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.[23](https://github.com/smartcontractkit/chainlink/actions/runs/11940570982/job/33283529603#step:19:24).3/x64/src/testing/testing.go:1743 +0x825
  github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2_test.TestFluxMonitor_Deviation()
      /home/runner/work/chainlink/chainlink/core/services/fluxmonitorv2/integrations_test.go:442 +0xcf
  testing.tRunner()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1690 +0x226
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1743 +0x44

Goroutine 343 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1743 +0x8[25](https://github.com/smartcontractkit/chainlink/actions/runs/11940570982/job/33283529603#step:19:26)
  github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2_test.TestFluxMonitor_Deviation()
      /home/runner/work/chainlink/chainlink/core/services/fluxmonitorv2/integrations_test.go:442 +0xcf
  testing.tRunner()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1690 +0x2[26](https://github.com/smartcontractkit/chainlink/actions/runs/11940570982/job/33283529603#step:19:27)
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1743 +0x44
==================

Copy link
Contributor

github-actions bot commented Nov 20, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@jmank88 jmank88 force-pushed the fluxmon-deviation-test-fix branch from 4054de6 to 5c553aa Compare November 20, 2024 20:20
@jmank88 jmank88 marked this pull request as ready for review November 20, 2024 20:20
@jmank88 jmank88 requested review from a team as code owners November 20, 2024 20:20
@jmank88 jmank88 requested a review from pavel-raykov November 20, 2024 20:20
@jmank88 jmank88 enabled auto-merge November 20, 2024 21:02
@jmank88 jmank88 requested review from samsondav and a team November 20, 2024 21:48
@jmank88 jmank88 added this pull request to the merge queue Nov 20, 2024
Merged via the queue into develop with commit 226211a Nov 20, 2024
144 of 146 checks passed
@jmank88 jmank88 deleted the fluxmon-deviation-test-fix branch November 20, 2024 22:14
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