我正在尝试使用nase2-3运行sawtooth xo tp单元测试,但是代码已挂起。当我按Ctrl-C退出时,将显示以下内容。基本上,TP测试用例会调用注册模拟验证器,并且该调用永远不会返回,因为ZMQ Poller正在等待某些东西。
我上周使用的是Python 3.5.2的Ubutnu 16 LTS,并在上周使用hyperledger / sawtooth-core进行了重新基准化,所以我正在使用最新代码运行简单的配置。
我在这里做什么错了?
谢谢。
envoy:~/git/sawtooth-core/sdk/examples/xo_python$ nose2-3 tests.test_tp_xo
^C
----------------------------------------------------------------------
Ran 0 tests in 2.608s
OK
Traceback (most recent call last):
File "/usr/bin/nose2-3", line 9, in <module>
load_entry_point('nose2==0.6.4', 'console_scripts', 'nose2')()
File "/usr/lib/python3/dist-packages/nose2/main.py", line 306, in discover
return main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/nose2/main.py", line 100, in __init__
super(PluggableTestProgram, self).__init__(**kw)
File "/usr/lib/python3.5/unittest/main.py", line 94, in __init__
self.runTests()
File "/usr/lib/python3/dist-packages/nose2/main.py", line 271, in runTests
self.result = runner.run(self.test)
File "/usr/lib/python3/dist-packages/nose2/runner.py", line 53, in run
executor(test, result)
File "/usr/lib/python3/dist-packages/nose2/runner.py", line 41, in <lambda>
executor = lambda suite, result: suite(result)
File "/usr/lib/python3.5/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.5/unittest/suite.py", line 122, in run
test(result)
File "/usr/lib/python3.5/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.5/unittest/suite.py", line 122, in run
test(result)
File "/usr/lib/python3.5/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.5/unittest/suite.py", line 122, in run
test(result)
File "/usr/lib/python3.5/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.5/unittest/suite.py", line 114, in run
self._handleClassSetUp(test, result)
File "/usr/lib/python3.5/unittest/suite.py", line 163, in _handleClassSetUp
setUpClass()
File "/project/git/sawtooth-core/sdk/examples/xo_python/tests/test_tp_xo.py", line 29, in setUpClass
super().setUpClass()
File "/usr/lib/python3/dist-packages/sawtooth_processor_test/transaction_processor_test_case.py", line 31, in setUpClass
if not cls.validator.register_processor():
File "/usr/lib/python3/dist-packages/sawtooth_processor_test/mock_validator.py", line 128, in register_processor
message, ident = self.receive()
File "/usr/lib/python3/dist-packages/sawtooth_processor_test/mock_validator.py", line 187, in receive
self._receive()
File "/usr/lib/python3.5/asyncio/base_events.py", line 375, in run_until_complete
self.run_forever()
File "/usr/lib/python3.5/asyncio/base_events.py", line 345, in run_forever
self._run_once()
File "/usr/lib/python3.5/asyncio/base_events.py", line 1276, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3/dist-packages/zmq/asyncio.py", line 232, in select
fd_event_list = self._zmq_poller.poll(timeout)
File "/usr/lib/python3/dist-packages/zmq/sugar/poll.py", line 99, in poll
return zmq_poll(self.sockets, timeout=timeout)
File "zmq/backend/cython/_poll.pyx", line 115, in zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:1705)
File "zmq/backend/cython/checkrc.pxd", line 12, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/_poll.c:2084)
KeyboardInterrupt
答案 0 :(得分:0)
您是否尝试过在同一目录中运行Dockerfile-tests-installed
?
这些测试主要用于在已设置完整测试环境的情况下自动使用。请参阅顶级github目录中的Jenkinsfile
。
如果只想运行并尝试一下,则可以按照以下说明在Ubuntu或Docker中运行它: https://sawtooth.hyperledger.org/docs/core/releases/latest/app_developers_guide/installing_sawtooth.html
基本上,您可以安装Sawtooth,Docker,docker-compose并运行:
docker-compose -f sawtooth-default.yaml up
然后您可以使用以下命令从Docker Shell运行Sawtooth命令:
docker exec -it sawtooth-shell-default bash