Websocket Autobahn Testsuite 未处理错误(Windows 和 Ubuntu)

Posted

技术标签:

【中文标题】Websocket Autobahn Testsuite 未处理错误(Windows 和 Ubuntu)【英文标题】:Websocket Autobahn Testsuite Unhandled Error (Windows and Ubuntu) 【发布时间】:2013-10-08 11:51:38 【问题描述】:

我刚刚在我的 Windows 7 和 Ubuntu 上安装了 Autobahn Testsuite 0.5.5。 每次我想运行它时,我都会遇到同样的错误。

我的设置:

Python 2.7.5 设置工具 1.1.6 Twisted 13.1.0 for Python 2.7 AutobahnPython 0.6.3

知道可能是什么原因吗? 问候,亚当

Ubuntu 12.04

Ok, will run 16 test cases against 1 servers
Cases = ['1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7', '1.1.8', '1.2.1', '1.2.2', '1.2.3', '1.2.4', '1.2.5', '1.2.6', '1.2.7', '1.2.8']
Servers = [u'ws://127.0.0.1:8099@MyAwesomeServer']
Running test case ID 1.1.1 for agent MyAwesomeServer from peer 127.0.0.1:8099
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/bin/wstest", line 9, in <module>
    load_entry_point('autobahntestsuite==0.5.5', 'console_scripts', 'wstest')()
  File "/usr/local/lib/python2.7/dist-packages/autobahntestsuite-0.5.5-py2.7.egg/autobahntestsuite/wstest.py", line 351, in run
    reactor.run()
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.1.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 1192, in run
    self.mainLoop()
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.1.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 1201, in mainLoop
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.1.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 824, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.1.0-py2.7-linux-x86_64.egg/twisted/internet/tcp.py", line 485, in connectionLost
    self._commonConnection.connectionLost(self, reason)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.1.0-py2.7-linux-x86_64.egg/twisted/internet/tcp.py", line 299, in connectionLost
    protocol.connectionLost(reason)
  File "/usr/local/lib/python2.7/dist-packages/autobahntestsuite-0.5.5-py2.7.egg/autobahntestsuite/fuzzing.py", line 1201, in connectionLost
    FuzzingProtocol.connectionLost(self, reason)
  File "/usr/local/lib/python2.7/dist-packages/autobahntestsuite-0.5.5-py2.7.egg/autobahntestsuite/fuzzing.py", line 211, in connectionLost
    "isServer": self.isServer,
exceptions.AttributeError: FuzzingClientProtocol instance has no attribute 'isServer'

Windows 7

Servers = [u'ws://echo.websocket.org@AutobahnPython']
Running test case ID 1.1.1 for agent AutobahnPython from peer 174.129.224.73:80
Unhandled Error
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\autobahntestsuite-0.5.5-py2.7.egg\autobahntestsuite\wstest.py", line 351, in run
    reactor.run()
  File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
    self.mainLoop()
  File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1204, in mainLoop
    self.doIteration(t)
  File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 145, in doSelect
    _logrun(selectable, _drdw, selectable, method, dict)
--- <exception caught here> ---
  File "C:\Python27\lib\site-packages\twisted\python\log.py", line 88, in callWithLogger
    return callWithContext("system": lp, func, *args, **kw)
  File "C:\Python27\lib\site-packages\twisted\python\log.py", line 73, in callWithContext
    return context.call(ILogContext: newCtx, func, *args, **kw)
  File "C:\Python27\lib\site-packages\twisted\python\context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "C:\Python27\lib\site-packages\twisted\python\context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 156, in _doReadOrWriteself._disconnectSelectable(selectable, why, method=="doRead")
  File "C:\Python27\lib\site-packages\twisted\internet\posixbase.py", line 257,in _disconnectSelectable
    selectable.readConnectionLost(f)
  File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 279, in readConnectionLost
    self.connectionLost(reason)
  File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 485, in connectionLost
    self._commonConnection.connectionLost(self, reason)
  File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 299, in connectionLost
    protocol.connectionLost(reason)
  File "C:\Python27\lib\site-packages\autobahntestsuite-0.5.5-py2.7.egg\autobahntestsuite\fuzzing.py", line 1201, in connectionLost
    FuzzingProtocol.connectionLost(self, reason)
  File "C:\Python27\lib\site-packages\autobahntestsuite-0.5.5-py2.7.egg\autobahntestsuite\fuzzing.py", line 211, in connectionLost
    "isServer": self.isServer,
exceptions.AttributeError: FuzzingClientProtocol instance has no attribute 'isServer'

【问题讨论】:

您使用的是哪个 AutobahnPython 版本?应该是 0.5.14。因为:0.6 是几天前发布的,但我们还需要发布一个新的 AutobahnTestsuite 包。但这还没有发生。 谢谢,这是我使用 0.6.3 AutobahnPython 时遇到的问题 【参考方案1】:

谢谢, 这就是我使用 AutobahnPython 0.6.3 时遇到的问题。

对于其他人: 如果你想运行 Autobahn Testsuite 0.5.5,你需要安装 AutobahnPython 0.5.14:https://pypi.python.org/pypi/autobahn/0.5.14

【讨论】:

AutobahnTestsuite 0.5.6 现在支持 AutobahnPython 0.6.3。

以上是关于Websocket Autobahn Testsuite 未处理错误(Windows 和 Ubuntu)的主要内容,如果未能解决你的问题,请参考以下文章

如何将 HTTP 请求升级到 Websocket (Autobahn & Twisted Web)

使用 Python Twisted 和 Autobahn 从 Matlab 通过 WebSocket 发送 JSON 数据

Kubernetes Python客户端:使用Autobahn websocket连接到pod /服务/使用bearer token连接

Websocket Autobahn Testsuite 未处理错误(Windows 和 Ubuntu)

Python - 在单独的子进程或线程中运行 Autobahn|Python asyncio websocket 服务器

Python 安全 websocket 内存消耗