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

Tests: Various race fixes and move TestFixtureToDataHandler #1534

Merged
merged 11 commits into from May 16, 2024

Conversation

gbjk
Copy link
Collaborator

@gbjk gbjk commented May 5, 2024

  • Fix a instance pair manager race intermittently causing Bitfinex and Kraken to fail
  • Fix PairsManager.Load breaking matcher
  • Fix UpdatePairsOnce not working across instances
  • Move and Simplify FixtureToDataHandler
  • Rename PairStore.copy to PairStore.clone and replace various builtin copy with slices.Clone
  • Add Fullstore.clone and PairFormat.clone

Type of change

  • Test fixes and improvements

How has this been tested

  • go test ./... -race
  • golangci-lint run

@gbjk gbjk added the test(s) fix This is to denote the PR is fixing a build test issue label May 5, 2024
@gbjk gbjk self-assigned this May 5, 2024
@gbjk gbjk added the review me This pull request is ready for review label May 5, 2024
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, only some pedantic things, that you can resolve at your choosing. Nice.

currency/manager.go Show resolved Hide resolved
currency/manager.go Outdated Show resolved Hide resolved
currency/pair.go Outdated Show resolved Hide resolved
currency/manager.go Show resolved Hide resolved
currency/manager.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 74.79675% with 31 lines in your changes are missing coverage. Please review.

Project coverage is 37.87%. Comparing base (34ef09d) to head (93fee81).

❗ Current head 93fee81 differs from pull request most recent head 0708926. Consider uploading reports for the commit 0708926 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1534      +/-   ##
==========================================
+ Coverage   35.89%   37.87%   +1.97%     
==========================================
  Files         409      412       +3     
  Lines      177453   147950   -29503     
==========================================
- Hits        63699    56031    -7668     
+ Misses     105899    84057   -21842     
- Partials     7855     7862       +7     
Files Coverage Δ
currency/pair.go 86.90% <100.00%> (+2.12%) ⬆️
exchanges/okx/okx_websocket.go 35.69% <100.00%> (+3.18%) ⬆️
exchanges/sharedtestvalues/sharedtestvalues.go 70.23% <100.00%> (-1.74%) ⬇️
exchanges/exchange.go 79.74% <80.00%> (+3.52%) ⬆️
exchanges/gateio/gateio.go 16.34% <60.00%> (+2.15%) ⬆️
exchanges/okx/okx.go 22.53% <60.00%> (+2.38%) ⬆️
currency/manager.go 94.96% <95.58%> (+1.53%) ⬆️
exchanges/okx/okx_wrapper.go 33.29% <42.85%> (+2.58%) ⬆️
internal/testing/exchange/exchange.go 47.32% <0.00%> (-3.49%) ⬇️

... and 382 files with indirect coverage changes

@gbjk gbjk requested a review from shazbert May 6, 2024 01:52
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some 🏃 racey features left over here

@gbjk
Copy link
Collaborator Author

gbjk commented May 6, 2024

Fixed with 2e9e7d6 and 1481244
In both cases I've shied away from going and changing everything to remove the (very) thin wrappers around CurrencyManager methods
Also haven't gone hunting for other examples of intrusion (yet)

Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, thanks for addressing my change requests. There's a couple of error on the CI build

currency/manager.go Outdated Show resolved Hide resolved
exchanges/gateio/gateio.go Show resolved Hide resolved
@gbjk gbjk force-pushed the feature/squirter branch 3 times, most recently from 752fe2e to 907d016 Compare May 7, 2024 11:10
@gbjk gbjk requested a review from shazbert May 7, 2024 12:27
@gbjk
Copy link
Collaborator Author

gbjk commented May 7, 2024

@shazbert Shout when you're done with this (and/or resolve threads).
I'll rebase it on master and resolve the conflict before @gloriousCode starts his review.

Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good 👍 can proceed with rebase.

currency/manager_test.go Show resolved Hide resolved
@gbjk gbjk force-pushed the feature/squirter branch 3 times, most recently from 0b928df to 93fee81 Compare May 8, 2024 02:09
@gbjk
Copy link
Collaborator Author

gbjk commented May 8, 2024

@shazbert Following discussion with @thrasher- I've switched it back to using a new PairsManager.IsAssetSupported.

Fixed 93fee81

Everything else was a rebase of what you've already seen.

@gbjk gbjk requested a review from shazbert May 8, 2024 02:10
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. tACK! 🚀

Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes ACK.

@gbjk gbjk mentioned this pull request May 15, 2024
4 tasks
Copy link
Collaborator

@gloriousCode gloriousCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK!

if ps == nil {
return nil, errPairStoreIsNil
return nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the error here and making returning nil an acceptable situation is something that could lead to panics as not much code is prepared for that.

At present it looks like only a botched test via Load will lead to this which is acceptable and addressable by the offending user, but I still need to point out because 🦕

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood.

@shazbert shazbert added the szrc shazbert review complete label May 16, 2024
Copy link
Collaborator

@thrasher- thrasher- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK, nice work! NOTE: BTSE issues are being worked on in a separate branch.

@thrasher- thrasher- merged commit 7d1eecf into thrasher-corp:master May 16, 2024
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review me This pull request is ready for review szrc shazbert review complete test(s) fix This is to denote the PR is fixing a build test issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants