blockscout icon indicating copy to clipboard operation
blockscout copied to clipboard

Flaking tests

Open sl1depengwyn opened this issue 2 years ago • 8 comments

  • [ ] ⚠️ test evaluate_authenticity/2 verifies smart contract compiled with Solidity 0.5.9 (includes new metadata in bytecode) with constructor args and does not verify with wrong args (Explorer.SmartContract.Solidity.VerifierTest) (test/explorer/smart_contract/solidity/verifier_test.exs:269)

    Error:      test/explorer/smart_contract/solidity/verifier_test.exs:269
         match (=) failed
         code:  assert {:error, :constructor_arguments} =
                  Verifier.evaluate_authenticity(contract_address_1.hash, params_1)
         left:  {:error, :constructor_arguments}
         right: {:error,
                 %{
                   "code" => 3,
                   "message" => "Json deserialize error: invalid type: null, expected a map at line 1 column 9020"
                 }}
         stacktrace:
           test/explorer/smart_contract/solidity/verifier_test.exs:325: (test)
    
  • [x] ⚠️ test run/2 compiles in an older solidity version (Explorer.SmartContract.Solidity.CodeCompilerTest) (test/explorer/smart_contract/solidity/code_compiler_test.exs:159)

    Error:      test/explorer/smart_contract/solidity/code_compiler_test.exs:159
        match (=) failed
        code:  assert {:ok, %{"abi" => _, "bytecode" => _, "name" => _}} = response
        left:  {:ok, %{"abi" => _, "bytecode" => _, "name" => _}}
        right: {:error, :compilation}
        stacktrace:
          test/explorer/smart_contract/solidity/code_compiler_test.exs:181: (test) 
    
  • [x] ⚠️ test list_logs/1 paginates logs (test/explorer/etherscan/logs_test.exs:181)


    2024-02-06T10:59:35.3572096Z 1) test list_logs/1 paginates logs (Explorer.Etherscan.LogsTest) 2024-02-06T10:59:35.3584995Z ##[error] test/explorer/etherscan/logs_test.exs:181 2024-02-06T10:59:35.3588076Z Expected truthy, got false 2024-02-06T10:59:35.3588932Z code: assert Enum.all?(inserted_records, fn record -> 2024-02-06T10:59:35.3589983Z Enum.any?(all_found_logs, fn found_log -> found_log.index == record.index end) 2024-02-06T10:59:35.3590671Z end) 2024-02-06T10:59:35.3590910Z arguments: 2024-02-06T10:59:35.3591070Z 2024-02-06T10:59:35.3591161Z # 1 2024-02-06T10:59:35.3591500Z [ 2024-02-06T10:59:35.3591950Z %Explorer.Chain.Log{ 2024-02-06T10:59:35.3592453Z meta: #Ecto.Schema.Metadata<:loaded, "logs">, 2024-02-06T10:59:35.3592975Z data: %Explorer.Chain.Data{bytes: <<1, 178>>}, 2024-02-06T10:59:35.3593585Z first_topic: nil, 2024-02-06T10:59:35.3593937Z second_topic: nil, 2024-02-06T10:59:35.3594243Z third_topic: nil, 2024-02-06T10:59:35.3594644Z fourth_topic: nil, 2024-02-06T10:59:35.3595165Z index: 434, 2024-02-06T10:59:35.3595505Z block_number: 1595, 2024-02-06T10:59:35.3596153Z inserted_at: ~U[2024-02-06 10:59:32.586755Z], 2024-02-06T10:59:35.3596725Z updated_at: ~U[2024-02-06 10:59:32.586755Z], 2024-02-06T10:59:35.3597400Z address_hash: %Explorer.Chain.Hash{ 2024-02-06T10:59:35.3597786Z byte_count: 20, 2024-02-06T10:59:35.3598262Z bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2024-02-06T10:59:35.3598665Z 0, 0, 27, 233>> 2024-02-06T10:59:35.3598952Z }, 2024-02-06T10:59:35.3599499Z address: %Explorer.Chain.Address{ 2024-02-06T10:59:35.3599985Z meta: #Ecto.Schema.Metadata<:loaded, "addresses">, 2024-02-06T10:59:35.3600429Z hash: %Explorer.Chain.Hash{ 2024-02-06T10:59:35.3600781Z byte_count: 20, 2024-02-06T10:59:35.3601154Z bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2024-02-06T10:59:35.3601564Z 0, 0, 0, 27, 233>> 2024-02-06T10:59:35.3602095Z }, 2024-02-06T10:59:35.3602371Z fetched_coin_balance: nil, 2024-02-06T10:59:35.3602853Z fetched_coin_balance_block_number: nil, 2024-02-06T10:59:35.3603696Z contract_code: %Explorer.Chain.Data{ 2024-02-06T10:59:35.3604409Z bytes: <<96, 128, 96, 64, 82, 96, 4, 54, 16, 96, 73, 2024-02-06T10:59:35.3605239Z 87, 96, 0, 53, 124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2024-02-06T10:59:35.3606098Z 0, 0, 0, 0, ...>> 2024-02-06T10:59:35.3606678Z }, 2024-02-06T10:59:35.3607132Z nonce: nil, 2024-02-06T10:59:35.3607635Z decompiled: false, 2024-02-06T10:59:35.3608190Z verified: false, 2024-02-06T10:59:35.3608776Z has_decompiled_code?: nil, 2024-02-06T10:59:35.3609431Z stale?: nil, 2024-02-06T10:59:35.3609992Z transactions_count: nil, 2024-02-06T10:59:35.3610648Z token_transfers_count: nil, 2024-02-06T10:59:35.3611282Z gas_used: nil, 2024-02-06T10:59:35.3611869Z ens_domain_name: nil, 2024-02-06T10:59:35.3612821Z smart_contract: #Ecto.Association.NotLoaded, 2024-02-06T10:59:35.3614124Z token: #Ecto.Association.NotLoaded, 2024-02-06T10:59:35.3615781Z contracts_creation_internal_transaction: #Ecto.Association.NotLoaded, 2024-02-06T10:59:35.3617857Z contracts_creation_transaction: #Ecto.Association.NotLoaded, 2024-02-06T10:59:35.3619696Z names: #Ecto.Association.NotLoaded, 2024-02-06T10:59:35.3621085Z decompiled_smart_contracts: #Ecto.Association.NotLoaded, 2024-02-06T10:59:35.3622704Z withdrawals: #Ecto.Association.NotLoaded, 2024-02-06T10:59:35.3623915Z inserted_at: ~U[2024-02-06 10:59:32.581001Z], 2024-02-06T10:59:35.3624752Z updated_at: ~U[2024-02-06 10:59:32.581001Z] 2024-02-06T10:59:35.3625388Z }, 2024-02-06T10:59:35.3625919Z transaction_hash: %Explorer.Chain.Hash{ 2024-02-06T10:59:35.3626648Z byte_count: 32, 2024-02-06T10:59:35.3627284Z bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2024-02-06T10:59:35.3628010Z 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 61>> 2024-02-06T10:59:35.3628647Z }, 2024-02-06T10:59:35.3629176Z transaction: %Explorer.Chain.Transaction{ 2024-02-06T10:59:35.3630050Z meta: #Ecto.Schema.Metadata<:loaded, "transactions">, 2024-02-06T10:59:35.3630777Z hash: %Explorer.Chain.Hash{ 2024-02-06T10:59:35.3631328Z byte_count: 32, 2024-02-06T10:59:35.3631910Z bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2024-02-06T10:59:35.3632601Z 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 2024-02-06T10:59:35.3633183Z ...>> 2024-02-06T10:59:35.3633563Z }, 2024-02-06T10:59:35.3633820Z block_number: 1595, 2024-02-06T10:59:35.3634139Z block_consensus: true, 2024-02-06T10:59:35.3634829Z block_timestamp: ~U[2024-02-06 10:59:32.583377Z], 2024-02-06T10:59:35.3635599Z cumulative_gas_used: Decimal.new("38793"), 2024-02-06T10:59:35.3636325Z earliest_processing_start: nil, 2024-02-06T10:59:35.3636994Z error: nil, 2024-02-06T10:59:35.3637531Z gas: Decimal.new("30334"), 2024-02-06T10:59:35.3638240Z gas_price: #Explorer.Chain.Wei<8800000000>, 2024-02-06T10:59:35.3638983Z gas_used: Decimal.new("43234"), 2024-02-06T10:59:35.3639632Z index: 0, 2024-02-06T10:59:35.3640220Z created_contract_code_indexed_at: nil, 2024-02-06T10:59:35.3641013Z input: %Explorer.Chain.Data{bytes: <<5, 61>>}, 2024-02-06T10:59:35.3641737Z nonce: 991, 2024-02-06T10:59:35.3642286Z r: Decimal.new("1341"), 2024-02-06T10:59:35.3642902Z s: Decimal.new("1341"), 2024-02-06T10:59:35.3644196Z status: :error, 2024-02-06T10:59:35.3645486Z v: Decimal.new("27"), 2024-02-06T10:59:35.3646164Z value: #Explorer.Chain.Wei<13427>, 2024-02-06T10:59:35.3646883Z revert_reason: nil, 2024-02-06T10:59:35.3647514Z max_priority_fee_per_gas: nil, 2024-02-06T10:59:35.3648102Z max_fee_per_gas: nil, 2024-02-06T10:59:35.3648616Z type: nil, 2024-02-06T10:59:35.3649127Z has_error_in_internal_txs: nil, 2024-02-06T10:59:35.3649807Z has_token_transfers: nil, 2024-02-06T10:59:35.3650463Z transaction_fee_log: nil, 2024-02-06T10:59:35.3651116Z transaction_fee_token: nil, 2024-02-06T10:59:35.3651741Z old_block_hash: nil, 2024-02-06T10:59:35.3652536Z inserted_at: ~U[2024-02-06 10:59:32.582470Z], 2024-02-06T10:59:35.3653397Z updated_at: ~U[2024-02-06 10:59:32.584757Z], 2024-02-06T10:59:35.3654086Z block_hash: %Explorer.Chain.Hash{ 2024-02-06T10:59:35.3654699Z byte_count: 32, 2024-02-06T10:59:35.3655254Z bytes: <<0, ...>> ... 2024-02-06T10:59:35.4836692Z 2024-02-06T10:59:35.4836837Z # 2 2024-02-06T10:59:35.4837443Z #Function<0.13885538/1 in Explorer.Etherscan.LogsTest."test list_logs/1 paginates logs"/1> 2024-02-06T10:59:35.4837458Z 2024-02-06T10:59:35.4837628Z stacktrace: 2024-02-06T10:59:35.4837919Z test/explorer/etherscan/logs_test.exs:216: (test)

      </details>
    
  • [x] test /addresses/{address_hash}/tabs-counters check counters cache ttl (test/block_scout_web/controllers/api/v2/address_controller_test.exs:2074)

    2024-02-06T18:02:22.3186637Z 1) test /addresses/{address_hash}/tabs-counters check counters cache ttl (BlockScoutWeb.API.V2.AddressControllerTest) 2024-02-06T18:02:22.3192070Z ##[error] test/block_scout_web/controllers/api/v2/address_controller_test.exs:2074 2024-02-06T18:02:22.3194170Z ** (EXIT from #PID<0.15868.0>) an exception was raised: 2024-02-06T18:02:22.3195158Z ** (ArgumentError) errors were found at the given arguments: 2024-02-06T18:02:22.3195880Z
    2024-02-06T18:02:22.3196536Z * 1st argument: the table identifier does not refer to an existing ETS table 2024-02-06T18:02:22.3197343Z
    2024-02-06T18:02:22.3198222Z (stdlib 4.3.1.3) :ets.delete(:addresses_tabs_counters, {:task, "0x0000000000000000000000000000000000001e32", :txs_to}) 2024-02-06T18:02:22.3200149Z (explorer 6.1.0) lib/explorer/chain/cache/addresses_tabs_counters.ex:37: Explorer.Chain.Cache.AddressesTabsCounters.drop_task/2 2024-02-06T18:02:22.3202386Z (explorer 6.1.0) lib/explorer/chain/address/counters.ex:392: anonymous fn/3 in Explorer.Chain.Address.Counters.address_limited_counters/2 2024-02-06T18:02:22.3205061Z (elixir 1.14.5) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2 2024-02-06T18:02:22.3206382Z (elixir 1.14.5) lib/task/supervised.ex:34: Task.Supervised.reply/4 2024-02-06T18:02:22.3207349Z (stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

  • [x] test init/1 schedules a sweep (EthereumJSONRPC.RollingWindowTest) (test/ethereum_jsonrpc/rolling_window_test.exs:17)

    Error:      test/ethereum_jsonrpc/rolling_window_test.exs:17
     Found message matching :sweep after 10ms.
    
     This means the message was delivered too close to the timeout value, you may want to either:
    
       1. Give an increased timeout to `assert_receive/2`
       2. Increase the default timeout to all `assert_receive` in your
          test_helper.exs by setting ExUnit.configure(assert_receive_timeout: ...)
    
     code: assert_receive :sweep
     stacktrace:
       test/ethereum_jsonrpc/rolling_window_test.exs:19: (test)
    
  • [x] test /addresses/{address_hash} get EIP-1167 proxy contract info (BlockScoutWeb.API.V2.AddressControllerTest)

    ``` Error: test/block_scout_web/controllers/api/v2/address_controller_test.exs:98 match (=) failed The following variables were pinned: tx_hash = "0x0000000000000000000000000000000000000000000000000000000000000928" name = "Implementation" implementation_contract_address_hash_string = "0000000000000000000000000000000000008f90" from = "0x0000000000000000000000000000000000008F92" address_hash = "0x0000000000000000000000000000000000008f91" code: assert %{ "hash" => ^address_hash, "is_contract" => true, "is_verified" => true, "private_tags" => [], "public_tags" => [], "watchlist_names" => [], "creator_address_hash" => ^from, "creation_tx_hash" => ^tx_hash, "implementation_address" => "0x" ^implementation_contract_address_hash_string, "implementations" => [ %{"address" => "0x" ^implementation_contract_address_hash_string, "name" => ^name} ] } = json_response(request, 200) left: %{ "hash" => ^address_hash, "is_contract" => true, "is_verified" => true, "private_tags" => [], "public_tags" => [], "watchlist_names" => [], "creator_address_hash" => ^from, "creation_tx_hash" => ^tx_hash, "implementation_address" => "0x" ^implementation_contract_address_hash_string, "implementations" => [ %{"address" => "0x" ^implementation_contract_address_hash_string, "name" => ^name} ] } right: %{ "block_number_balance_updated_at" => nil, "coin_balance" => nil, "creation_tx_hash" => "0x0000000000000000000000000000000000000000000000000000000000000928", "creator_address_hash" => "0x0000000000000000000000000000000000008F92", "ens_domain_name" => nil, "exchange_rate" => nil, "has_beacon_chain_withdrawals" => false, "has_decompiled_code" => false, "has_logs" => false, "has_token_transfers" => false, "has_tokens" => false, "has_validated_blocks" => false, "hash" => "0x0000000000000000000000000000000000008f91", "implementation_address" => "0x0000000000000000000000000000000000008f90", "implementation_name" => "Implementation", "implementations" => [ %{ "address" => "0x0000000000000000000000000000000000008F90", "name" => "Implementation" } ], "is_contract" => true, "is_verified" => true, "metadata" => nil, "name" => nil, "private_tags" => [], "public_tags" => [], "token" => nil, "watchlist_address_id" => nil, "watchlist_names" => [] } stacktrace: test/block_scout_web/controllers/api/v2/address_controller_test.exs:171: (test) ```

sl1depengwyn avatar Feb 06 '24 17:02 sl1depengwyn

More of flickering tests:

  • [x] ⚠️ test/explorer/chain/cache/gas_price_oracle_test.exs:362

    test get_average_gas_price/4 return gas prices with average block time if earliest_processing_start is not available (Explorer.Chain.Cache.GasPriceOracleTest) Error: test/explorer/chain/cache/gas_price_oracle_test.exs:362 ** (FunctionClauseError) no function clause matching in Decimal.decimal/1
      The following arguments were given to Decimal.decimal/1:
    
          # 1
          nil
    
      Attempted function clauses (showing 4 out of 4):
    
          defp decimal(-%Decimal{} = num-)
          defp decimal(num) when -is_integer(num)-
          defp decimal(num) when -is_binary(num)-
          defp decimal(other) when -is_float(other)-
    
      code: }, _} = GasPriceOracle.get_average_gas_price(3, 35, 60, 90)
      stacktrace:
        (decimal 2.1.1) lib/decimal.ex:1910: Decimal.decimal/1
        (decimal 2.1.1) lib/decimal.ex:996: Decimal.mult/2
        (explorer 6.7.2) lib/explorer/chain/cache/gas_price_oracle.ex:276: Explorer.Chain.Cache.GasPriceOracle.fiat_fee/2
        (explorer 6.7.2) lib/explorer/chain/cache/gas_price_oracle.ex:262: Explorer.Chain.Cache.GasPriceOracle.compose_gas_price/5
        (explorer 6.7.2) lib/explorer/chain/cache/gas_price_oracle.ex:229: Explorer.Chain.Cache.GasPriceOracle.process_fee_data_from_db/1
        (explorer 6.7.2) lib/explorer/chain/cache/gas_price_oracle.ex:177: Explorer.Chain.Cache.GasPriceOracle.get_average_gas_price/4
        test/explorer/chain/cache/gas_price_oracle_test.exs:461: (test)
    

    ....................... Error: 08:52:49.447 [error] Task #PID<0.33760.0> started from #PID<0.33722.0> terminating

  • [x] ⚠️ test/block_scout_web/controllers/api/v2/smart_contract_controller_test.exs:97 test/block_scout_web/controllers/api/v2/smart_contract_controller_test.exs:172 test/block_scout_web/controllers/api/v2/smart_contract_controller_test.exs:502 test/block_scout_web/controllers/api/v2/smart_contract_controller_test.exs:32 test/explorer/chain/smart_contract/proxy_test.exs:430

    1) test /smart-contracts/{address_hash} get smart-contract (BlockScoutWeb.API.V2.SmartContractControllerTest) Error: test/block_scout_web/controllers/api/v2/smart_contract_controller_test.exs:97 ** (EXIT from #PID) an exception was raised:
            ** (FunctionClauseError) no function clause matching in anonymous fn/2 in Explorer.TestHelper.mock_beacon_storage_pointer_request/3
    
            The following arguments were given to anonymous fn/2 in Explorer.TestHelper.mock_beacon_storage_pointer_request/3:
    
                # 1
                %{id: 0, params: [%Explorer.Chain.Hash{byte_count: 20, bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 56, 54>>}, "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", "latest"], method: "eth_getStorageAt", jsonrpc: "2.0"}
    
                # 2
                []
    
            stacktrace:
              (explorer 6.7.2) lib/test_helper.ex:36: anonymous fn/2 in Explorer.TestHelper.mock_beacon_storage_pointer_request/3
              (ethereum_jsonrpc 6.7.2) lib/ethereum_jsonrpc/request_coordinator.ex:89: anonymous fn/4 in EthereumJSONRPC.RequestCoordinator.perform/4
              (ethereum_jsonrpc 6.7.2) lib/ethereum_jsonrpc/request_coordinator.ex:109: EthereumJSONRPC.RequestCoordinator.trace_request/2
              (ethereum_jsonrpc 6.7.2) lib/ethereum_jsonrpc.ex:454: EthereumJSONRPC.json_rpc/2
              (explorer 6.7.2) lib/explorer/chain/smart_contract/proxy.ex:185: Explorer.Chain.SmartContract.Proxy.get_implementation_from_storage/3
              (explorer 6.7.2) lib/explorer/chain/smart_contract/proxy/eip_1967.ex:39: Explorer.Chain.SmartContract.Proxy.EIP1967.get_implementation_address_hash_string/1
              (explorer 6.7.2) lib/explorer/chain/smart_contract/proxy.ex:298: Explorer.Chain.SmartContract.Proxy.get_implementation_address_hash_string_by_module/4
              (explorer 6.7.2) lib/explorer/chain/smart_contract/proxy.ex:61: Explorer.Chain.SmartContract.Proxy.fetch_implementation_address_hash/3
              (explorer 6.7.2) lib/explorer/chain/smart_contract/proxy/models/implementation.ex:175: anonymous fn/3 in Explorer.Chain.SmartContract.Proxy.Models.Implementation.get_implementation/2
              (elixir 1.16.3) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
              (elixir 1.16.3) lib/task/supervised.ex:36: Task.Supervised.reply/4
    
  • [x] test/block_scout_web/controllers/api/v2/address_controller_test.exs:59

    1) test /addresses/{address_hash} get address & get the same response for checksummed and downcased parameter (BlockScoutWeb.API.V2.AddressControllerTest) Error: test/block_scout_web/controllers/api/v2/address_controller_test.exs:59 match (=) failed The following variables were pinned: correct_response = %{"block_number_balance_updated_at" => nil, "coin_balance" => nil, "creation_tx_hash" => nil, "creator_address_hash" => nil, "ens_domain_name" => nil, "exchange_rate" => nil, "has_beacon_chain_withdrawals" => false, "has_decompiled_code" => false, "has_logs" => false, "has_token_transfers" => false, "has_tokens" => false, "has_validated_blocks" => false, "hash" => "0x000000000000000000000000000000000000B917", "implementation_address" => nil, "implementation_name" => nil, "implementations" => [], "is_contract" => false, "is_verified" => false, "metadata" => nil, "name" => nil, "private_tags" => [], "public_tags" => [], "token" => nil, "watchlist_address_id" => nil, "watchlist_names" => []} code: assert ^correct_response = json_response(request, 200) left: ^correct_response right: %{ "block_number_balance_updated_at" => nil, "coin_balance" => nil, "creation_tx_hash" => nil, "creator_address_hash" => nil, "ens_domain_name" => nil, "exchange_rate" => "2.5", "has_beacon_chain_withdrawals" => false, "has_decompiled_code" => false, "has_logs" => false, "has_token_transfers" => false, "has_tokens" => false, "has_validated_blocks" => false, "hash" => "0x000000000000000000000000000000000000B917", "implementation_address" => nil, "implementation_name" => nil, "implementations" => [], "is_contract" => false, "is_verified" => false, "metadata" => nil, "name" => nil, "private_tags" => [], "public_tags" => [], "token" => nil, "watchlist_address_id" => nil, "watchlist_names" => [] } stacktrace: test/block_scout_web/controllers/api/v2/address_controller_test.exs:92: (test)
  • [x] test/block_scout_web/controllers/api/v2/stats_controller_test.exs:40

    2) test /stats/charts/market get empty data (BlockScoutWeb.API.V2.StatsControllerTest) Error: test/block_scout_web/controllers/api/v2/stats_controller_test.exs:40 Assertion with == failed code: assert response["chart_data"] == [] left: [ %{ "closing_price" => "2.5", "date" => "2024-07-05", "market_cap" => "0.0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-07-04", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-07-03", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-07-02", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-07-01", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-06-30", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-06-29", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-06-28", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-06-27", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", %{ "closing_price" => "1", "date" => "2024-06-09", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-06-08", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-06-07", "market_cap" => "0", "tvl" => nil }, %{ "closing_price" => "1", "date" => "2024-06-06", "market_cap" => "0", "tvl" => nil } ] right: [] stacktrace: test/block_scout_web/controllers/api/v2/stats_controller_test.exs:44: (test)
  • [x] test/block_scout_web/controllers/api/v2/address_controller_test.exs:2421

    1) test /addresses get empty list (BlockScoutWeb.API.V2.AddressControllerTest) Error: test/block_scout_web/controllers/api/v2/address_controller_test.exs:2421 match (=) failed The following variables were pinned: total_supply = "252460800" code: assert %{ "items" => [], "next_page_params" => nil, "exchange_rate" => nil, "total_supply" => ^total_supply } = json_response(request, 200) left: %{ "items" => [], "next_page_params" => nil, "exchange_rate" => nil, "total_supply" => ^total_supply } right: %{ "exchange_rate" => "2.5", "items" => [], "next_page_params" => nil, "total_supply" => "252460800" } stacktrace: test/block_scout_web/controllers/api/v2/address_controller_test.exs:2426: (test)

vbaranov avatar Jul 05 '24 10:07 vbaranov

  • [x] 1) test current day values are saved in state (Explorer.Market.History.CatalogerTest)

    Error: test/explorer/market/history/cataloger_test.exs:167 match (=) failed code: assert [ %Explorer.Market.MarketHistory{date: ~D"2018-04-01"} = first_entry, %Explorer.Market.MarketHistory{date: ~D"2018-04-02"} = second_entry ] = MarketHistory |> order_by(asc: :date) |> Repo.all() left: [ %Explorer.Market.MarketHistory{date: ~D[2018-04-01]} = first_entry, %Explorer.Market.MarketHistory{date: ~D[2018-04-02]} = second_entry ] right: [ %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 100, closing_price: Decimal.new("10"), date: ~D[2018-04-01], opening_price: Decimal.new("5"), market_cap: nil, tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 351, closing_price: Decimal.new("20"), date: ~D[2018-04-02], opening_price: Decimal.new("5"), market_cap: nil, tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 349, closing_price: nil, date: ~D[2023-10-31], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 105, closing_price: nil, date: ~D[2023-11-01], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 114, closing_price: nil, date: ~D[2023-11-02], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 123, closing_price: nil, date: ~D[2023-11-03], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 132, closing_price: nil, date: ~D[2023-11-04], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 141, closing_price: nil, date: ~D[2023-11-05], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 150, closing_price: nil, date: ~D[2023-11-06], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 159, closing_price: nil, date: ~D[2023-11-07], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 168, closing_price: nil, date: ~D[2023-11-08], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 177, closing_price: nil, date: ~D[2023-11-09], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 185, closing_price: nil, date: ~D[2023-11-10], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 193, closing_price: nil, date: ~D[2023-11-11], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 201, closing_price: nil, date: ~D[2023-11-12], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 209, closing_price: nil, date: ~D[2023-11-13], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 217, closing_price: nil, date: ~D[2023-11-14], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 225, closing_price: nil, date: ~D[2023-11-15], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 233, closing_price: nil, date: ~D[2023-11-16], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 241, closing_price: nil, date: ~D[2023-11-17], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 249, closing_price: nil, date: ~D[2023-11-18], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 257, closing_price: nil, date: ~D[2023-11-19], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 265, closing_price: nil, date: ~D[2023-11-20], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 273, closing_price: nil, date: ~D[2023-11-21], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 281, closing_price: nil, date: ~D[2023-11-22], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 289, closing_price: nil, date: ~D[2023-11-23], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 297, closing_price: nil, date: ~D[2023-11-24], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 305, closing_price: nil, date: ~D[2023-11-25], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 313, closing_price: nil, date: ~D[2023-11-26], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 321, closing_price: nil, date: ~D[2023-11-27], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 329, closing_price: nil, date: ~D[2023-11-28], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 337, closing_price: nil, date: ~D[2023-11-29], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 344, closing_price: nil, date: ~D[2023-11-30], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 106, closing_price: nil, date: ~D[2023-12-01], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 115, closing_price: nil, date: ~D[2023-12-02], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 124, closing_price: nil, date: ~D[2023-12-03], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 133, closing_price: nil, date: ~D[2023-12-04], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 142, closing_price: nil, date: ~D[2023-12-05], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 151, closing_price: nil, date: ~D[2023-12-06], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 160, closing_price: nil, date: ~D[2023-12-07], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 169, closing_price: nil, date: ~D[2023-12-08], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 178, closing_price: nil, date: ~D[2023-12-09], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, secondary_coin: false }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 186, closing_price: nil, date: ~D[2023-12-10], opening_price: nil, market_cap: Decimal.new("0.0"), tvl: nil, ... }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 194, closing_price: nil, date: ~D[2023-12-11], opening_price: nil, market_cap: Decimal.new("0.0"), ... }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 202, closing_price: nil, date: ~D[2023-12-12], opening_price: nil, ... }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 210, closing_price: nil, date: ~D[2023-12-13], ... }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 218, closing_price: nil, ... }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, id: 226, ... }, %Explorer.Market.MarketHistory{ __meta__: #Ecto.Schema.Metadata<:loaded>, ... }, %Explorer.Market.MarketHistory{...}, ... ] stacktrace: test/explorer/market/history/cataloger_test.exs:218: (test)
  • [x] 2) ** (exit) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started code: assert is_integer(TransactionCache.estimated_count())

    Error: test/explorer/chain_test.exs:2224 ** (exit) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started code: assert is_integer(TransactionCache.estimated_count()) stacktrace: (con_cache 1.1.0) lib/con_cache/owner.ex:14: ConCache.Owner.cache/1 (con_cache 1.1.0) lib/con_cache.ex:228: ConCache.get/2 (explorer 6.7.2) lib/explorer/chain/cache/transaction.ex:6: Explorer.Chain.Cache.Transaction.get/1 (explorer 6.7.2) lib/explorer/chain/cache/transaction.ex:27: Explorer.Chain.Cache.Transaction.estimated_count/0 test/explorer/chain_test.exs:2225: (test)
  • [x] 3) test does not update cache if cache period did not pass (Explorer.Chain.Cache.BlockTest)

    Error: test/explorer/chain/cache/block_test.exs:32 Assertion with == failed code: assert updated_value == 2 left: 0 right: 2 stacktrace: test/explorer/chain/cache/block_test.exs:43: (test)
  • [ ] 4) test check retries count and refetch after proper updates retries count and refetch after on retry (Indexer.Fetcher.TokenInstance.HelperTest)

    ``` Error: test/indexer/fetcher/token_instance/helper_test.exs:412 Assertion with
  • [ ] 5) 1) test GET index/2 JSON returns next_page_path when there are more items (BlockScoutWeb.AddressTokenTransferControllerTest)

    Error: test/block_scout_web/controllers/address_token_transfer_controller_test.exs:151 ** (Ecto.ConstraintError) constraint error when attempting to insert struct:
           * "one_consensus_block_at_height" (unique_constraint)
    
       If you would like to stop this constraint violation from raising an
       exception and instead add it as an error to your changeset, please
       call `unique_constraint/3` on your changeset with the constraint
       `:name` as an option.
    
       The changeset has not defined any constraint.
    
       code: |> Enum.map(fn index ->
       stacktrace:
         (ecto 3.11.2) lib/ecto/repo/schema.ex:815: anonymous fn/4 in Ecto.Repo.Schema.constraints_to_errors/3
         (elixir 1.16.3) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
         (ecto 3.11.2) lib/ecto/repo/schema.ex:799: Ecto.Repo.Schema.constraints_to_errors/3
         (ecto 3.11.2) lib/ecto/repo/schema.ex:780: Ecto.Repo.Schema.apply/4
         (ecto 3.11.2) lib/ecto/repo/schema.ex:377: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
         (ecto 3.11.2) lib/ecto/association.ex:1279: Ecto.Association.BelongsTo.on_repo_change/5
         (ecto 3.11.2) lib/ecto/association.ex:624: Ecto.Association.on_repo_change/7
         (elixir 1.16.3) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
         (ecto 3.11.2) lib/ecto/association.ex:589: Ecto.Association.on_repo_change/4
         (ecto 3.11.2) lib/ecto/repo/schema.ex:922: Ecto.Repo.Schema.process_parents/6
         (ecto 3.11.2) lib/ecto/repo/schema.ex:351: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
         (ecto 3.11.2) lib/ecto/repo/schema.ex:1033: anonymous fn/3 in Ecto.Repo.Schema.wrap_in_transaction/6
         (ecto_sql 3.11.3) lib/ecto/adapters/sql.ex:1358: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
         (db_connection 2.6.0) lib/db_connection.ex:1710: DBConnection.run_transaction/4
         (ecto 3.11.2) lib/ecto/repo/schema.ex:273: Ecto.Repo.Schema.insert!/4
         test/block_scout_web/controllers/address_token_transfer_controller_test.exs:165: anonymous fn/3 in BlockScoutWeb.AddressTokenTransferControllerTest."test GET index/2 JSON returns next_page_path when there are more items"/1
         (elixir 1.16.3) lib/enum.ex:4365: Enum.map_range/4
         (elixir 1.16.3) lib/enum.ex:4365: Enum.map_range/4
         (elixir 1.16.3) lib/enum.ex:4365: Enum.map/2
         test/block_scout_web/controllers/address_token_transfer_controller_test.exs:157: (test)
    
  • [ ] 6) test /smart-contracts/{address_hash} get an eip1967 proxy contract (BlockScoutWeb.API.V2.SmartContractControllerTest)(Indexer.Fetcher.TokenInstance.HelperTest)

    ```
    Error:      test/block_scout_web/controllers/api/v2/smart_contract_controller_test.exs:76
         ** (EXIT from #PID<0.14529.0>) an exception was raised:
             ** (Mox.UnexpectedCallError) no expectation defined for EthereumJSONRPC.Mox.json_rpc/2 in process #PID<0.14553.0> (or in its callers [#PID<0.14529.0>]) with args [%{id: 0, params: [%Explorer.Chain.Hash{byte_count: 20, bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, 166>>}, "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", "latest"], method: "eth_getStorageAt", jsonrpc: "2.0"}, []]
                 (mox 1.1.0) lib/mox.ex:820: Mox.__dispatch__/4
                 (ethereum_jsonrpc 6.9.0) lib/ethereum_jsonrpc/request_coordinator.ex:89: anonymous fn/4 in EthereumJSONRPC.RequestCoordinator.perform/4
                 (ethereum_jsonrpc 6.9.0) lib/ethereum_jsonrpc/request_coordinator.ex:109: EthereumJSONRPC.RequestCoordinator.trace_request/2
                 (ethereum_jsonrpc 6.9.0) lib/ethereum_jsonrpc.ex:532: EthereumJSONRPC.json_rpc/2
                 (explorer 6.9.0) lib/explorer/chain/smart_contract/proxy.ex:195: Explorer.Chain.SmartContract.Proxy.get_implementation_from_storage/3
                 (explorer 6.9.0) lib/explorer/chain/smart_contract/proxy/eip_1967.ex:39: Explorer.Chain.SmartContract.Proxy.EIP1967.get_implementation_address_hash_string/1
                 (explorer 6.9.0) lib/explorer/chain/smart_contract/proxy.ex:372: Explorer.Chain.SmartContract.Proxy.get_implementation_address_hash_string_by_module/4
                 (explorer 6.9.0) lib/explorer/chain/smart_contract/proxy.ex:63: Explorer.Chain.SmartContract.Proxy.fetch_implementation_address_hash/3
                 (explorer 6.9.0) lib/explorer/chain/smart_contract/proxy/models/implementation.ex:213: anonymous fn/3 in Explorer.Chain.SmartContract.Proxy.Models.Implementation.get_implementation/2
                 (elixir 1.17.3) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
                 (elixir 1.17.3) lib/task/supervised.ex:36: Task.Supervised.reply/4
    
    </details>
    
    

nikitosing avatar Jul 09 '24 11:07 nikitosing

  • [x] test updates cache if initial value is zero (Explorer.Chain.Cache.BlockTest)

    Error: test/explorer/chain/cache/block_test.exs:18 Assertion with == failed code: assert updated_value == 2 left: 0 right: 2 stacktrace: test/explorer/chain/cache/block_test.exs:29: (test) >
  • [x] test updates cache if initial value is zero (Explorer.Chain.Cache.AddressSumTest)

    Error: test/explorer/chain/cache/address_sum_test.exs:18 ** (FunctionClauseError) no function clause matching in Decimal.to_integer/1
     The following arguments were given to Decimal.to_integer/1:
    
         # 1
         0
    
     Attempted function clauses (showing 4 out of 4):
    
         def to_integer(-%Decimal{sign: sign, coef: coef, exp: 0}-) when -is_integer(coef)-
         def to_integer(-%Decimal{sign: sign, coef: coef, exp: exp}-) when -is_integer(coef)- and -exp > 0-
         def to_integer(-%Decimal{sign: sign, coef: coef, exp: exp}-) when -is_integer(coef)- and -exp < 0- and -rem(coef, 10) == 0-
         def to_integer(-%Decimal{coef: coef} = decimal-) when -is_integer(coef)-
    
     code: updated_value = Decimal.to_integer(AddressSum.get_sum())
     stacktrace:
       (decimal 2.1.1) lib/decimal.ex:1468: Decimal.to_integer/1
       test/explorer/chain/cache/address_sum_test.exs:28: (test)
    

    </>

sl1depengwyn avatar Jul 10 '24 11:07 sl1depengwyn

  • [ ] Test account/api/account/v2/user watchlist address returns with token balances info + handle nil fiat values (BlockScoutWeb.Account.Api.V2.UserControllerTest)
    Error: test/block_scout_web/controllers/account/api/v2/user_controller_test.exs:799 Assertion with == failed code: assert wa1["tokens_fiat_value"] |> Decimal.new() |> Decimal.round(13) == values |> Enum.reduce(Decimal.new(0), fn x, acc -> Decimal.add(x, acc) end) |> Decimal.round(13) left: Decimal.new("8527.7466494321747") right: Decimal.new("8527.7466494321748") stacktrace: test/block_scout_web/controllers/account/api/v2/user_controller_test.exs:834: (test) >
  • [ ] Test account/api/account/v2/user watchlist address returns with token balances info (BlockScoutWeb.Account.Api.V2.UserControllerTest)
    Error: test/block_scout_web/controllers/account/api/v2/user_controller_test.exs:733 Assertion with == failed code: assert wa2["tokens_fiat_value"] |> Decimal.new() |> Decimal.round(13) == values_1 |> Enum.reduce(Decimal.new(0), fn x, acc -> Decimal.add(x, acc) end) |> Decimal.round(13) left: Decimal.new("10192.8186647459866") right: Decimal.new("10192.8186647459867") stacktrace: test/block_scout_web/controllers/account/api/v2/user_controller_test.exs:792: (test) >

sl1depengwyn avatar Jul 10 '24 12:07 sl1depengwyn

  • [x] Test Check how works retry in realtime retry once after timeout (Indexer.Fetcher.TokenInstance.RealtimeTest). Example of failed job
    Error: test/indexer/fetcher/token_instance/realtime_test.exs:29 Assertion with == failed code: assert instance.metadata == %{"name" => "name"} left: nil right: %{"name" => "name"} stacktrace: test/indexer/fetcher/token_instance/realtime_test.exs:119: (test)

fedor-ivn avatar Jul 11 '24 11:07 fedor-ivn

  • [ ] test publish/2 with valid data creates a smart_contract (Explorer.SmartContract.Vyper.PublisherTest)
    Error: test/explorer/smart_contract/vyper/publisher_test.exs:24 match (=) failed code: assert {:ok, %SmartContract{} = smart_contract} = response left: {:ok, %Explorer.Chain.SmartContract{} = smart_contract} right: {:error, #Ecto.Changeset, valid?: false >} stacktrace: test/explorer/smart_contract/vyper/publisher_test.exs:40: (test) >
  • [ ] test publish/2 allows to re-verify vyper contracts (Explorer.SmartContract.Vyper.PublisherTest)
    Error: test/explorer/smart_contract/vyper/publisher_test.exs:50 match (=) failed code: assert {:ok, %SmartContract{}} = response left: {:ok, %Explorer.Chain.SmartContract{}} right: {:error, #Ecto.Changeset, valid?: false >} stacktrace: test/explorer/smart_contract/vyper/publisher_test.exs:66: (test) >
  • [ ] test publish/2 validates and creates smart contract with external libraries (Explorer.SmartContract.Solidity.PublisherTest)
    Error: test/explorer/smart_contract/solidity/publisher_test.exs:153 match (=) failed code: assert {:ok, %SmartContract{} = _smart_contract} = response left: {:ok, %Explorer.Chain.SmartContract{} = _smart_contract} right: {:error, #Ecto.Changeset= a, \"SafeMath: addition overflow\"); return c; }}contract SimpleStorage { uint256 storedData = 10; using BadSafeMath for uint256; function increment(uint256 x) public { storedData = storedData.add(x); } function set(uint256 x) public { storedData = x; } function get() public view returns (uint256) { return storedData; }}", is_blueprint: false, is_vyper_contract: false, optimization: true, partially_verified: false, verified_via_eth_bytecode_db: false, verified_via_sourcify: false, verified_via_verifier_alliance: false }, errors: [ contract_source_code: {"Unexpected error", []} ], data: #Explorer.Chain.SmartContract, valid?: false >} stacktrace: test/explorer/smart_contract/solidity/publisher_test.exs:194: (test) >

failed job example

k1rill-fedoseev avatar Jul 19 '24 09:07 k1rill-fedoseev

  • [ ] test cover new functionality from https://github.com/blockscout/blockscout/pull/5479 return {:error, :deployed_bytecode} (Explorer.SmartContract.Solidity.VerifierTest)
    Error: test/explorer/smart_contract/solidity/verifier_test.exs:1167 match (=) failed code: assert {:error, :deployed_bytecode} = Verifier.evaluate_authenticity(contract_address.hash, params) left: {:error, :deployed_bytecode} right: {:error, %{ "code" => 3, "message" => "Json deserialize error: invalid type: null, expected a map at line 1 column 2757" }} stacktrace: test/explorer/smart_contract/solidity/verifier_test.exs:1193: (test) >
  • [ ] test check retries count and refetch after proper updates retries count and refetch after on retry (Indexer.Fetcher.TokenInstance.HelperTest)
    Error: test/indexer/fetcher/token_instance/helper_test.exs:412 Assertion with

failed job example

k1rill-fedoseev avatar Jul 24 '24 10:07 k1rill-fedoseev

14 tests from Explorer.Etherscan.LogsTest started flickering again. The following is an example:

  • [x] :warning: test list_logs/1 paginates logs (Explorer.Etherscan.LogsTest)
    Error: test/explorer/etherscan/logs_test.exs:181 Assertion with == failed code: assert Enum.count(first_found_logs) == 1000 left: 0 right: 1000 stacktrace: test/explorer/etherscan/logs_test.exs:201: (test) >

failed job example

fedor-ivn avatar Aug 13 '24 10:08 fedor-ivn

  • [ ] 1) test Sanitize duplicated log index logs correctly identifies and updates duplicated log index logs & updates corresponding token transfers and token instances (Explorer.Migrator.SanitizeDuplicatedLogIndexLogsTest)
Error: test/explorer/migrator/sanitize_duplicated_log_index_logs_test.exs:52 match (match?) failed code: assert match?( [ %{index: 0, data: %Explorer.Chain.Data{bytes: >}}, %{index: 1, data: %Explorer.Chain.Data{bytes: >}}, %{index: 2, data: %Explorer.Chain.Data{bytes: >}} ], updated_logs ) left: [ %{index: 0, data: %Explorer.Chain.Data{bytes: >}}, %{index: 1, data: %Explorer.Chain.Data{bytes: >}}, %{index: 2, data: %Explorer.Chain.Data{bytes: >}} ] right: [ %Explorer.Chain.Log{ __meta__: #Ecto.Schema.Metadata<:loaded>, data: %Explorer.Chain.Data{bytes: >}, first_topic: nil, second_topic: nil, third_topic: nil, fourth_topic: nil, index: 0, block_number: 7692, inserted_at: ~U[2024-11-05 14:50:27.222850Z], updated_at: ~U[2024-11-05 14:50:27.222850Z], address_hash: %Explorer.Chain.Hash{ byte_count: 20, bytes: > }, address: #Ecto.Association.NotLoaded, block_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, block: #Ecto.Association.NotLoaded, transaction_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, transaction: #Ecto.Association.NotLoaded }, %Explorer.Chain.Log{ __meta__: #Ecto.Schema.Metadata<:loaded>, data: %Explorer.Chain.Data{bytes: >}, first_topic: nil, second_topic: nil, third_topic: nil, fourth_topic: nil, index: 3, block_number: 7692, inserted_at: ~U[2024-11-05 14:50:27.221644Z], updated_at: ~U[2024-11-05 14:50:27.221644Z], address_hash: %Explorer.Chain.Hash{ byte_count: 20, bytes: > }, address: #Ecto.Association.NotLoaded, block_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, block: #Ecto.Association.NotLoaded, transaction_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, transaction: #Ecto.Association.NotLoaded }, %Explorer.Chain.Log{ __meta__: #Ecto.Schema.Metadata<:loaded>, data: %Explorer.Chain.Data{bytes: >}, first_topic: nil, second_topic: nil, third_topic: nil, fourth_topic: nil, index: 3, block_number: 7692, inserted_at: ~U[2024-11-05 14:50:27.223871Z], updated_at: ~U[2024-11-05 14:50:27.223871Z], address_hash: %Explorer.Chain.Hash{ byte_count: 20, bytes: > }, address: #Ecto.Association.NotLoaded, block_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, block: #Ecto.Association.NotLoaded, transaction_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, transaction: #Ecto.Association.NotLoaded } ] stacktrace: test/explorer/migrator/sanitize_duplicated_log_index_logs_test.exs:114: (test)
  • [ ] 2) test Sanitize duplicated log index logs correctly identifies and updates duplicated log index logs (Explorer.Migrator.SanitizeDuplicatedLogIndexLogsTest)
Error: test/explorer/migrator/sanitize_duplicated_log_index_logs_test.exs:12 match (match?) failed code: assert match?( [ %{index: 0, data: %Explorer.Chain.Data{bytes: >}}, %{index: 1, data: %Explorer.Chain.Data{bytes: >}}, %{index: 2, data: %Explorer.Chain.Data{bytes: >}} ], updated_logs ) left: [ %{index: 0, data: %Explorer.Chain.Data{bytes: >}}, %{index: 1, data: %Explorer.Chain.Data{bytes: >}}, %{index: 2, data: %Explorer.Chain.Data{bytes: >}} ] right: [ %Explorer.Chain.Log{ __meta__: #Ecto.Schema.Metadata<:loaded>, data: %Explorer.Chain.Data{bytes: >}, first_topic: nil, second_topic: nil, third_topic: nil, fourth_topic: nil, index: 0, block_number: 7703, inserted_at: ~U[2024-11-05 14:50:27.749690Z], updated_at: ~U[2024-11-05 14:50:27.749690Z], address_hash: %Explorer.Chain.Hash{ byte_count: 20, bytes: > }, address: #Ecto.Association.NotLoaded, block_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, block: #Ecto.Association.NotLoaded, transaction_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, transaction: #Ecto.Association.NotLoaded }, %Explorer.Chain.Log{ __meta__: #Ecto.Schema.Metadata<:loaded>, data: %Explorer.Chain.Data{bytes: >}, first_topic: nil, second_topic: nil, third_topic: nil, fourth_topic: nil, index: 3, block_number: 7703, inserted_at: ~U[2024-11-05 14:50:27.748097Z], updated_at: ~U[2024-11-05 14:50:27.748097Z], address_hash: %Explorer.Chain.Hash{ byte_count: 20, bytes: > }, address: #Ecto.Association.NotLoaded, block_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, block: #Ecto.Association.NotLoaded, transaction_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, transaction: #Ecto.Association.NotLoaded }, %Explorer.Chain.Log{ __meta__: #Ecto.Schema.Metadata<:loaded>, data: %Explorer.Chain.Data{bytes: >}, first_topic: nil, second_topic: nil, third_topic: nil, fourth_topic: nil, index: 3, block_number: 7703, inserted_at: ~U[2024-11-05 14:50:27.750913Z], updated_at: ~U[2024-11-05 14:50:27.750913Z], address_hash: %Explorer.Chain.Hash{ byte_count: 20, bytes: > }, address: #Ecto.Association.NotLoaded, block_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, block: #Ecto.Association.NotLoaded, transaction_hash: %Explorer.Chain.Hash{ byte_count: 32, bytes: > }, transaction: #Ecto.Association.NotLoaded } ] stacktrace: test/explorer/migrator/sanitize_duplicated_log_index_logs_test.exs:35: (test)

vbaranov avatar Nov 06 '24 12:11 vbaranov

  • [ ] test viewing uncle blocks list lists uncle blocks (BlockScoutWeb.ViewingBlocksTest)
Error:      test/block_scout_web/features/viewing_blocks_test.exs:167
   ** (Wallaby.ExpectationNotMetError) Expected to find 1 visible element that matched the css '[data-block-number='18662']', but 0 visible elements were found.

   code: |> assert_has(BlockListPage.block(uncle))
   stacktrace:
     test/block_scout_web/features/viewing_blocks_test.exs:170: (test)

sl1depengwyn avatar Nov 13 '24 08:11 sl1depengwyn

  • [x] test Test account/api/account/v2/user watchlist address returns with token balances info (BlockScoutWeb.Account.Api.V2.UserControllerTest) https://github.com/blockscout/blockscout/pull/11242
test/block_scout_web/controllers/account/api/v2/user_controller_test.exs:742
    Assertion with == failed
    code:  assert wa1["tokens_fiat_value"] |> Decimal.new() ==
             values
             |> Enum.reduce(Decimal.new(0), fn x, acc -> Decimal.add(x, acc) end)
             |> dbg(limit: :infinity, printable_limit: :infinity)
    left:  Decimal.new("8045.9498963133990495")
    right: Decimal.new("8045.9498963133990501266")
    stacktrace:
      test/block_scout_web/controllers/account/api/v2/user_controller_test.exs:794: (test)

sl1depengwyn avatar Nov 22 '24 11:11 sl1depengwyn

  • [ ] test /addresses/{address_hash}/nft/collections get paginated erc-721 collection (BlockScoutWeb.API.V2.AddressControllerTest)
Error:      test/block_scout_web/controllers/api/v2/address_controller_test.exs:3421
    ** (Protocol.UndefinedError) protocol Enumerable not implemented for nil of type Atom. This protocol is implemented for the following type(s): Cldr.Unit.Range, DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, Explorer.BoundQueue, File.Stream, Floki.HTMLTree, Flow, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Postgrex.Stream, Range, Stream, Timex.Interval
    stacktrace:
      (elixir 1.17.3) lib/enum.ex:1: Enumerable.impl_for!/1
      (elixir 1.17.3) lib/enum.ex:166: Enumerable.reduce/3
      (elixir 1.17.3) lib/enum.ex:4423: Enum.reduce/3
      (stdlib 6.1.2) maps.erl:860: :maps.fold_1/4
      (mox 1.2.0) lib/mox.ex:848: Mox.__verify_mock_or_all__/2
      (mox 1.2.0) lib/mox.ex:819: anonymous fn/1 in Mox.verify_on_exit!/1
      (ex_unit 1.17.3) lib/ex_unit/on_exit_handler.ex:136: ExUnit.OnExitHandler.exec_callback/1
      (ex_unit 1.17.3) lib/ex_unit/on_exit_handler.ex:122: ExUnit.OnExitHandler.on_exit_runner_loop/0

sl1depengwyn avatar Apr 29 '25 11:04 sl1depengwyn