tokenika / eosfactory

Python-based EOS smart-contract development & testing framework
http://eosfactory.io/
Other
243 stars 62 forks source link

Node restart a lot of times when start a test (MacOS) #183

Open thieuanh1995hn opened 4 years ago

thieuanh1995hn commented 4 years ago
###  SCENARIO:
Create a contract from template, then build and deploy it.

Removing testnet cache for prefix `_127_0_0_1_8888_`
Testnet cache successfully removed.
Local node is stopped [].
Starting nodeos, cpu percent: 0, 0, 0, 0, 0; 0; 0; 0; 0; 0; 0;
Local node is stopped [].
Starting nodeos, cpu percent: 0, 0, 0, 0, 0; 0; 0; 0; 0; 0; 0;
Local node is stopped [].
Starting nodeos, cpu percent: 0, 0, 0, 0, 0; 0; 0; 0; 0; 0; 0;
Local node is stopped [7514].
Local node is stopped [].
ERROR:
The local 'nodeos' failed to start few times in sequence. Perhaps, something is
wrong with configuration of the system. See the command line issued:

nodeos --http-server-address 127.0.0.1:8888 --chain-state-db-size-mb 300 --contracts-console --verbose-http-errors --enable-stale-production --producer-name eosio --signature-provider EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --delete-all-blocks

Now, see the result of execution of the command line:

..

Just another hang incident of the 'nodeos' executable.

Rerun the script.

Everything fine nodes was started and eosio produced block like normal. Please help !

thieuanh1995hn commented 4 years ago

I know the issue . Cause this library parse result in terminal of cleos command to JSON . But my result show with some warning . So it make your solution error !

stefanzarembinski commented 4 years ago

Let me explain how does EOSFactory work. First, it issues a command to a System. In your case, the command is

nodeos --http-server-address 127.0.0.1:8888 --chain-state-db-size-mb 300 --contracts-console --verbose-http-errors --enable-stale-production --producer-name eosio --signature-provider EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --delete-all-blocks

Next, after a time (commas change to semicolons) EOSFactory successively (every second) sends the get info request to the local node. If few successful responses from the node are valid (semicolons change to starlets), EOSFActory is satisfied and reports that the local node is active.

For some reason, unknown to me, some Macs are slow with starting the nodeos and a newly launched node does not response before a preset timeout. This is a deficiency of the code and I will correct it.

You say that you have found a fix. Please, explain it to me.

If you have EOSFactory installed as GitHub repository, you can try to expand the timeout. In file eosfactory/core/teos.py, the timeout is set in line 771. Now, it is 7:

def node_probe():
    DELAY_TIME = 4
    WAIT_TIME = 1

    NUMBER_BLOCKS_ADDED = 3
    NUMBER_GET_INFO_CALLS = 7 # <--- here!
thieuanh1995hn commented 4 years ago

@stefanzarembinski

stefanzarembinski commented 4 years ago

EOSFactory will parse the result command cleos to JSON -- not exactly, it uses the command line literally as a bash command, exactly as you do it. Then it calls cleos get info command repeatably.

Your remark about the localization is precious to me. I will work on this issue.

Let you know that your suggestion about the web API (EOSJS) is under development now. However, it is not being implemented because of the localization issue that has to be fixed otherwise. Our reason for the EOSJS interface is having EOSFactory independent of the heavy dependency on EOS.

stefanzarembinski commented 4 years ago

@thieuanh1995hn, you say "When i Use my Mac with region is my country (Vietnam) Cleos show some warning every cleos command i see warning something about some symbols not support.". Will you, please, show me these warnings?

thieuanh1995hn commented 4 years ago
stefanzarembinski commented 4 years ago

Thank you. I will fix it.

stefanzarembinski commented 4 years ago

But, I see now that you show me a result from a call to cleos. Could you present the same effect with a Python EOSFactory script?

thieuanh1995hn commented 4 years ago

But, I see now that you show me a result from a call to cleos. Could you present the same effect with a Python EOSFactory script?

stefanzarembinski commented 4 years ago

Thank you. I will install Vietnamese on my system to see the problem.