zack-bitcoin / amoveo

A blockchain for trust-free markets in financial derivatives
Other
466 stars 110 forks source link

"make tests" fails in tests/spend.py #172

Closed tumblecatweed closed 6 years ago

tumblecatweed commented 6 years ago

Test fails here, but it's strange same function is called many times without error in this script.

request(2, "mine_block", [1,100000], 0.1)

Python version is 2.7.15

catweed@catweed:~/dev/crypto/amoveo/amoveo (master)*$ make tests
Kill all beam processes from this host
make multi-build
-------
get single header test
get many headers test
["ok",[-6]]
fork test: mine and sync test
fork test: sync three nodes test
spend test
Traceback (most recent call last):
  File "tests/test_all.py", line 14, in <module>
    spend_test()
  File "/home/catweed/dev/crypto/amoveo/amoveo/tests/spend.py", line 27, in spend_test
    request(2, "spend", [pub1, 10000000])# 0.1 veo
  File "/home/catweed/dev/crypto/amoveo/amoveo/tests/get_request.py", line 26, in request
    return request_helper(url, action, args, seconds_to_sleep)
  File "/home/catweed/dev/crypto/amoveo/amoveo/tests/get_request.py", line 33, in request_helper
    f = urllib2.urlopen(req)
  File "/home/catweed/.pyenv/versions/2.7.15/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/home/catweed/.pyenv/versions/2.7.15/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/home/catweed/.pyenv/versions/2.7.15/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/home/catweed/.pyenv/versions/2.7.15/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/home/catweed/.pyenv/versions/2.7.15/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/home/catweed/.pyenv/versions/2.7.15/lib/python2.7/urllib2.py", line 556, in http_error_defaul
t
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error
Makefile:263: recipe for target 'tests' failed
make: *** [tests] Error 1
zack-bitcoin commented 6 years ago

There is some non-deterministic errors in the integration tests. If you run them one at a time, it is easier to get them all to pass.

It would be nice if we could fix this.

tumblecatweed commented 6 years ago

174 I sent a PR to fix this issue. Please review.

zack-bitcoin commented 6 years ago

Great job

ghost commented 6 years ago

@tumblecatweed is this good to close now? Zack is pretty busy, if this is resolved, maybe you can close it.

zack-bitcoin commented 6 years ago

I was able to significantly decrease these errors by decreasing the target block time when using test mode.

If the target is too high, then tests fail because blocks fail to get mined.

if the target is too low, there is some error that happens when the blockchain is always trying to decrease the target, and the target hits zero. divide by zero or something I guess.

tumblecatweed commented 6 years ago

Thanks, I close this issue.