ainblockchain / ain-blockchain

Official Javascript implementation of AI Network Blockchain.
https://www.ainetwork.ai/
MIT License
67 stars 27 forks source link

[BUG] Broken integration test #1072

Closed platfowner closed 2 years ago

platfowner commented 2 years ago

Broken integration:

test log:

yarn run test_integration_sharding

yarn run v1.22.18
$ BLOCKCHAIN_CONFIGS_DIR=blockchain-configs/3-nodes ./node_modules/mocha/bin/mocha --timeout 640000 test/integration/sharding.test.js
[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /home/se/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /home/se/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /home/se/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /home/se/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /home/se/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /home/se/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js

  Sharding
[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /home/se/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /home/se/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /home/se/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /home/se/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /home/se/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /home/se/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js
[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /home/se/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /home/se/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /home/se/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /home/se/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /home/se/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /home/se/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js
[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /home/se/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /home/se/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /home/se/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /home/se/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /home/se/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /home/se/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js
[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /home/se/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /home/se/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /home/se/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /home/se/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /home/se/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /home/se/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js
[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /home/se/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /home/se/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /home/se/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /home/se/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /home/se/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /home/se/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js
[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /home/se/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /home/se/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /home/se/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /home/se/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /home/se/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /home/se/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /home/se/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js
    Parent chain initialization
      DB values
        ✓ sharding
        ✓ .shard
      DB functions
        ✓ sharding path
      DB rules
        ✓ sharding path
      DB owners
        ✓ sharding path
    Shard chain initialization
      DB values
        ✓ token
        ✓ accounts
        ✓ sharding
      DB functions
        ✓ sharding
      DB rules
        ✓ sharding
      DB owners
        ✓ sharding
    State proof hash reporting
      Periodic reports
        ✓ reports proof hashes periodically
      Latest block number
        ✓ updates latest block number
      Shard reporter node restart
        --> Shutting down server[0]...
        --> Restarting server[0]...
        1) can resume reporting after missing some reports
    API tests
Iteration count exceeded its limit before the given tx 0x6b7351c2cc65b24c1e55c878a06b9e2f075b59cdc1c01e5861587ed705c56be8 is finalized!
setUpApp(): Failed to check finalization of app staking tx.
Iteration count exceeded its limit before the given tx 0x068923d38a895f8351e4926d49f380b2b9e0c4e558da48524762e5abb3e3eddb is finalized!
setUpApp(): Failed to check finalization of create app tx.
      Get API
        2) "before all" hook in "Get API"
        3) "after all" hook in "Get API"
      Set API
        /set_value api
          4) "before each" hook for "/set_value with is_global = false"
          5) "after each" hook for "/set_value with is_global = false"
    Native functions
      _updateLatestShardReport
        ✓ update latest shard report (4079ms)
        ✓ update latest shard report - can handle reports that are out of order (4076ms)

  15 passing (19m)
  5 failing

  1) Sharding
       State proof hash reporting
         Shard reporter node restart
           can resume reporting after missing some reports:
     Error: Timeout of 640000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/se/ain-blockchain/test/integration/sharding.test.js)
      at listOnTimeout (node:internal/timers:559:17)
      at processTimers (node:internal/timers:502:7)

  2) Sharding
       API tests
         Get API
           "before all" hook in "Get API":

      AssertionError: expected true to deeply equal false
      + expected - actual

      -true
      +false

      at setUp (test/integration/sharding.test.js:156:10)
      at Context.<anonymous> (test/integration/sharding.test.js:500:15)
      at processImmediate (node:internal/timers:466:21)

  3) Sharding
       API tests
         Get API
           "after all" hook in "Get API":

      AssertionError: expected true to deeply equal false
      + expected - actual

      -true
      +false

      at cleanUp (test/integration/sharding.test.js:189:10)
      at Context.<anonymous> (test/integration/sharding.test.js:504:15)
      at processImmediate (node:internal/timers:466:21)

  4) Sharding
       API tests
         Set API
           "before each" hook for "/set_value with is_global = false":

      AssertionError: expected true to deeply equal false
      + expected - actual

      -true
      +false

      at setUp (test/integration/sharding.test.js:156:10)
      at Context.<anonymous> (test/integration/sharding.test.js:1597:15)
      at processImmediate (node:internal/timers:466:21)

  5) Sharding
       API tests
         Set API
           "after each" hook for "/set_value with is_global = false":

      AssertionError: expected true to deeply equal false
      + expected - actual

      -true
      +false

      at cleanUp (test/integration/sharding.test.js:189:10)
      at Context.<anonymous> (test/integration/sharding.test.js:1601:15)
      at processImmediate (node:internal/timers:466:21)

error Command failed with exit code 5.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

commit info:

git log --graph --abbrev-commit --decorate --first-parent

* commit eb35a95c (HEAD -> bugfix/platfowner/bugfix, develop)
| Merge: fe1d817f 13529015
| Author: minsulee2 <56950836+minsulee2@users.noreply.github.com>
| Date:   Thu Jun 23 17:57:14 2022 +0900
| 
|     Merge pull request #1060 from ainblockchain/feature/minsulee2/remove-old-peer-candidates
|     
|     Remove disconnectable peer candidates
| 
* commit fe1d817f
| Merge: f5f182a7 de117d1d
| Author: Doheun Kim <kdh75576795@gmail.com>
| Date:   Wed Jun 22 19:30:32 2022 +0900
| 
|     Merge pull request #1069 from ainblockchain/bugfix/ehgmsdk20/remove-failed-txs
|     
|     Remove invalid txs when finalize block
| 
* commit f5f182a7
| Merge: b7f27b85 1d033928
| Author: platfowner <seo@comcom.ai>
| Date:   Mon Jun 20 16:28:27 2022 +0900
| 
|     Merge pull request #1066 from ainblockchain/feature/platfowner/feature
|     
|     Simplify result format by not using 'error' property

target PR:

@minsulee2 could you take a look?

platfowner commented 2 years ago

It seems test_integration_he_sharding also needs to be updated. Could you take a look? @minsulee2

    Parent chain initialization
      DB values
        ✓ sharding
        ✓ .shard
      DB functions
        ✓ sharding path
      DB rules
        ✓ sharding path
      DB owners
        ✓ sharding path
    Shard chain initialization
      DB values
        ✓ token
        ✓ accounts
        ✓ sharding
      DB functions
        ✓ sharding
      DB rules
        ✓ sharding
      DB owners
        ✓ sharding
    State proof hash reporting
      Periodic reports
        ✓ reports proof hashes periodically
      Latest block number
        ✓ updates latest block number
      Shard reporter node restart
        --> Shutting down server[0]...
        --> Restarting server[0]...
        1) can resume reporting after missing some reports

  13 passing (13m)
  1 failing

  1) HE Sharding
       State proof hash reporting
         Shard reporter node restart
           can resume reporting after missing some reports:
     Error: Timeout of 640000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/seo/ain-blockchain/test/integration/he_sharding.test.js)
      at listOnTimeout (node:internal/timers:559:17)
      at processTimers (node:internal/timers:502:7)

error Command failed with exit code 1.
platfowner commented 2 years ago

Resolved, thanks!