Closed Bug 805151 Opened 12 years ago Closed 11 years ago

allow for talos to run with --develop on older versions of python

Categories

(Testing :: Talos, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jmaher, Assigned: wlach)

Details

Attachments

(1 file)

While running on Talos on linux and windows while using --develop, we get this in our logs:

Traceback (most recent call last):
  File "PerfConfigurator.py", line 864, in <module>
    sys.exit(main())
  File "PerfConfigurator.py", line 856, in main
    options, args = conf.parse_args(args)
  File "PerfConfigurator.py", line 521, in parse_args
    options, args = Configuration.parse_args(self, *args, **kwargs)
  File "/home/cltbld/talos-slave/talos-data/talos/configuration.py", line 476, in parse_args
    self(*config)
  File "PerfConfigurator.py", line 333, in __call__
    return Configuration.__call__(self, *args)
  File "/home/cltbld/talos-slave/talos-data/talos/configuration.py", line 380, in __call__
    self.validate()
  File "PerfConfigurator.py", line 425, in validate
    self.config['webserver'] = 'localhost:%s' % utils.findOpenPort('127.0.0.1')
  File "/home/cltbld/talos-slave/talos-data/talos/utils.py", line 277, in findOpenPort
    from mozdevice import devicemanager
  File "/home/cltbld/talos-slave/talos-data/talos/mozdevice/__init__.py", line 5, in <module>
    from devicemanager import DMError
  File "/home/cltbld/talos-slave/talos-data/talos/mozdevice/devicemanager.py", line 526
    raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range(0, (height - 1) * width * 4, width_byte_4))



can we try/except around this so we can run mozhttpd and --develop on production talos?
We could. I would prefer to just modify the methods in question not to depend on mozdevice.

For findOpenPort, we could replace it with something like this:

def get_open_port():
        import socket
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.bind(("",0))
        s.listen(1)
        port = s.getsockname()[1]
        s.close()
        return port

(this is actually a bad practice which we should eventually avoid, see: https://bugzilla.mozilla.org/show_bug.cgi?id=788604#c4)

For getLanIp(), we could just call into mozhttpd's iface method, something like:

mozhttpd.iface.get_lan_ip()
Meh, might as well actually do the patch too.
Assignee: nobody → wlachance
How about this?
Attachment #674803 - Flags: review?(jmaher)
Comment on attachment 674803 [details] [diff] [review]
Remove use of mozdevice's network tools

Review of attachment 674803 [details] [diff] [review]:
-----------------------------------------------------------------

this looks pretty good.
Attachment #674803 - Flags: review?(jmaher) → review+
right now we use python 2.7 everywhere, --develop works fine, can we close this bug?
wfm; closing.  Please reopen if this is still an issue.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: