Repository navigation
Closed
Labels
team-wallet-frameworkDeprecated: Please use `team-core-platform` instead.Deprecated: Please use `team-core-platform` instead.
Description
Description
The assets-controller tests are failing when run locally. Is there some additional setup needed for proxying the requests properly..?
As can be seen in the log below, the tests fail on the requests to the metafi endpoints. However, from the same shell that the tests are run from, the same endpoint responds without issues:
$ curl -i https://proxy.metafi.codefi.network/opensea/v1/api/v1/asset_contract/0x495f947276749Ce646f68AC8c248420045cb7b5e
HTTP/2 200
date: [...]
content-type: application/json
x-trace-id: [...]
vary: Accept, Origin, Accept-Encoding
allow: GET, OPTIONS
cache-control: public, max-age=300
age: 10
x-frame-options: DENY
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
referrer-policy: same-origin
cross-origin-opener-policy: same-origin
cf-cache-status: DYNAMIC
last-modified: [...]
strict-transport-security: max-age=15724800; includeSubDomains
server: cloudflare
cf-ray: [...]
Environment
Fresh checkout and node_modules from current main.
$ env | grep -i proxy
$ node --version
v18.13.0
$ yarn --version
3.3.0
Log
# inside `packages/assets-controllers`
$ yarn test
[...]
PASS assets-controllers src/NftController.test.ts (46.552 s)
● Console
console.error
FetchError {
message: 'request to https://proxy.metafi.codefi.network/opensea/v1/api/v1/asset_contract/0x495f947276749Ce646f68AC8c248420045cb7b5e failed, reason: Failed to fetch',
type: 'system',
errno: undefined,
code: undefined
}
534 | error === TIMEOUT_ERROR)
535 | ) {
> 536 | console.error(error);
| ^
537 | } else {
538 | throw error;
539 | }
at logOrRethrowError (../controller-utils/src/util.ts:536:13)
at ../controller-utils/src/util.ts:370:5
at Generator.throw (<anonymous>)
at rejected (../controller-utils/src/util.ts:6:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
console.error
FetchError {
message: 'request to https://proxy.metafi.codefi.network/opensea/v1/api/v1/asset_contract/0x6EbeAf8e8E946F0716E6533A6f2cefc83f60e8Ab failed, reason: Failed to fetch',
type: 'system',
errno: undefined,
code: undefined
}
534 | error === TIMEOUT_ERROR)
535 | ) {
> 536 | console.error(error);
| ^
537 | } else {
538 | throw error;
539 | }
at logOrRethrowError (../controller-utils/src/util.ts:536:13)
at ../controller-utils/src/util.ts:370:5
at Generator.throw (<anonymous>)
at rejected (../controller-utils/src/util.ts:6:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
console.error
FetchError {
message: 'request to https://proxy.metafi.codefi.network/opensea/v1/api/v1/asset_contract/0x60F80121C31A0d46B5279700f9DF786054aa5eE5 failed, reason: Failed to fetch',
type: 'system',
errno: undefined,
code: undefined
}
534 | error === TIMEOUT_ERROR)
535 | ) {
> 536 | console.error(error);
| ^
537 | } else {
538 | throw error;
539 | }
at logOrRethrowError (../controller-utils/src/util.ts:536:13)
at ../controller-utils/src/util.ts:370:5
at Generator.throw (<anonymous>)
at rejected (../controller-utils/src/util.ts:6:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
console.error
FetchError {
message: 'request to https://proxy.metafi.codefi.network/opensea/v1/api/v1/asset/0x60F80121C31A0d46B5279700f9DF786054aa5eE5/1144858 failed, reason: Failed to fetch',
type: 'system',
errno: undefined,
code: undefined
}
534 | error === TIMEOUT_ERROR)
535 | ) {
> 536 | console.error(error);
| ^
537 | } else {
538 | throw error;
539 | }
at logOrRethrowError (../controller-utils/src/util.ts:536:13)
at ../controller-utils/src/util.ts:370:5
at Generator.throw (<anonymous>)
at rejected (../controller-utils/src/util.ts:6:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
FAIL assets-controllers src/AssetsContractController.test.ts (56.857 s)
[...]
------------------------------------|---------|----------|---------|---------|---------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------------------------|---------|----------|---------|---------|---------------------------
All files | 96.73 | 89.39 | 96.2 | 96.65 |
src | 97.99 | 91.71 | 97.79 | 97.94 |
AccountTrackerController.ts | 98.25 | 83.33 | 100 | 98.15 | 186
AssetsContractController.ts | 97.47 | 93.55 | 100 | 97.47 | 187,371
CurrencyRateController.ts | 100 | 100 | 100 | 100 |
NftController.ts | 98.11 | 88.52 | 100 | 98.08 | 269,395,1125,1188,1257
NftDetectionController.ts | 95.31 | 85.37 | 93.75 | 95.08 | 181,270,284
TokenBalancesController.ts | 100 | 100 | 100 | 100 |
TokenDetectionController.ts | 98.77 | 84.85 | 100 | 98.73 | 135
TokenListController.ts | 98.94 | 89.13 | 100 | 98.88 | 151
TokenRatesController.ts | 95.74 | 93.48 | 96.15 | 95.56 | 126,207,252,413
TokensController.ts | 97.18 | 94.71 | 90.91 | 97.18 | 299,534,538-541,641-651
assetsUtil.ts | 100 | 100 | 100 | 100 |
crypto-compare.ts | 100 | 100 | 100 | 100 |
token-service.ts | 100 | 95 | 100 | 100 | 129
src/Standards | 97.14 | 66.67 | 100 | 97.14 |
ERC20Standard.ts | 97.14 | 66.67 | 100 | 97.14 | 82
src/Standards/NftStandards/ERC1155 | 64.71 | 11.76 | 68.42 | 64 |
ERC1155Standard.ts | 64.71 | 11.76 | 68.42 | 64 | 44-45,111-126,167,172-182
src/Standards/NftStandards/ERC721 | 98.44 | 85 | 100 | 98.36 |
ERC721Standard.ts | 98.44 | 85 | 100 | 98.36 | 204
------------------------------------|---------|----------|---------|---------|---------------------------
Test Suites: 1 failed, 15 passed, 16 total
Tests: 3 failed, 294 passed, 297 total
Snapshots: 0 total
Time: 61.658 s
Ran all test suites.
Metadata
Metadata
Assignees
Labels
team-wallet-frameworkDeprecated: Please use `team-core-platform` instead.Deprecated: Please use `team-core-platform` instead.
Activity
mcmire commentedon Aug 17, 2023
With #1499 merged, is this still an issue?
legobeat commentedon Aug 22, 2023
Somehow, yes:
mcmire commentedon Aug 22, 2023
Ah, right.
I think there are two things going on here:
core/packages/assets-controllers/src/NftController.test.ts
Line 270 in f99e384
core/packages/controller-utils/src/util.ts
Line 374 in f99e384
So I think these errors are expected, if a bit noisy.
legobeat commentedon Aug 22, 2023
A couple of actual test failures, though. Full log attached.
assets-controller-test.log
mcmire commentedon Aug 23, 2023
Hmm, I see. Thanks for posting that. I don't have any intuitions for why this is happening at the moment but can take a look when I get a chance.
desi commentedon May 1, 2024
Further investigation is needed on this.
desi commentedon May 1, 2024
Maybe this isn't happening anymore?
legobeat commentedon May 1, 2024
@desi It is not. Closing. Got any idea of when this was resolved?