Bug 1569235 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

We no longer support the passing 3 or more arguments to ok() since Bug 1499096.

However passing an int as second argument for `ok()` will fail but create a weird error message:

```
 0:03.99 TEST_START: devtools/client/webconsole/test/mochitest/browser_console_clear_method.js
 0:04.14 INFO Entering test bound 
Exception in thread ProcessReader:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/jdescottes/Development/hg/fx-team-artifact/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 1085, in _read
    callback(line.rstrip())
  File "/Users/jdescottes/Development/hg/fx-team-artifact/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 995, in __call__
    e(*args, **kwargs)
  File "/Users/jdescottes/Development/hg/fx-team-artifact/objdir.noindex/_tests/testing/mochitest/runtests.py", line 2995, in processOutputLine
    message = handler(message)
  File "/Users/jdescottes/Development/hg/fx-team-artifact/objdir.noindex/_tests/testing/mochitest/runtests.py", line 3100, in dumpScreenOnTimeout
    and "Test timed out" in message['subtest']):
TypeError: argument of type 'int' is not iterable
```

Here we crash on `"Test timed out" in message['subtest']` because `message['subtest']` is an int. 

I don't know if we should do some typecasting in runtests.py, but we can make sure we pass a string argument in the `ok()` checker:
https://searchfox.org/mozilla-central/rev/0bcdfa99339c0512e3730903835fb6f8ed45e3c4/testing/mochitest/browser-test.js#1573-1574
We no longer support the passing 3 or more arguments to ok() since Bug 1467712.

However passing an int as second argument for `ok()` will fail but create a weird error message:

```
 0:03.99 TEST_START: devtools/client/webconsole/test/mochitest/browser_console_clear_method.js
 0:04.14 INFO Entering test bound 
Exception in thread ProcessReader:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/jdescottes/Development/hg/fx-team-artifact/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 1085, in _read
    callback(line.rstrip())
  File "/Users/jdescottes/Development/hg/fx-team-artifact/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 995, in __call__
    e(*args, **kwargs)
  File "/Users/jdescottes/Development/hg/fx-team-artifact/objdir.noindex/_tests/testing/mochitest/runtests.py", line 2995, in processOutputLine
    message = handler(message)
  File "/Users/jdescottes/Development/hg/fx-team-artifact/objdir.noindex/_tests/testing/mochitest/runtests.py", line 3100, in dumpScreenOnTimeout
    and "Test timed out" in message['subtest']):
TypeError: argument of type 'int' is not iterable
```

Here we crash on `"Test timed out" in message['subtest']` because `message['subtest']` is an int. 

I don't know if we should do some typecasting in runtests.py, but we can make sure we pass a string argument in the `ok()` checker:
https://searchfox.org/mozilla-central/rev/0bcdfa99339c0512e3730903835fb6f8ed45e3c4/testing/mochitest/browser-test.js#1573-1574

Back to Bug 1569235 Comment 0