Closed Bug 1601105 Opened 5 years ago Closed 5 years ago

[unittest] test_android7_power - Make Android temporarily use on-the-fly generated profiles, rather than conditioned ones, until we add support for them

Categories

(Testing :: Raptor, defect, P1)

Version 3
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: stephend, Assigned: stephend)

References

()

Details

With my current approach for bug 1600838 (https://hg.mozilla.org/try/rev/04fb0b3f029f12050af255eca49fa5a2a351a3ba), I'm breaking (https://firefoxci.taskcluster-artifacts.net/WFp5ln9PRmagjXEf2dLztQ/0/public/logs/live_backing.log):

testing/raptor/test/test_power.py::test_android7_power

This looks to be because it's only calling get_current_platform, which gives the platform it's failing on the conditioned profile for that host platform. Until we fix bug 1597711 properly, this makes unittests fail in the following way:

[task 2019-12-03T22:08:39.423Z] 0:35.69 =================================== FAILURES ===================================
[task 2019-12-03T22:08:39.423Z] 0:35.69 _____________________________ test_android7_power ______________________________
[task 2019-12-03T22:08:39.423Z] 0:35.69
[task 2019-12-03T22:08:39.423Z] 0:35.69 def test_android7_power():
[task 2019-12-03T22:08:39.423Z] 0:35.69 if not os.getenv('MOZ_UPLOAD_DIR'):
[task 2019-12-03T22:08:39.423Z] 0:35.69 os.environ['MOZ_UPLOAD_DIR'] = tempfile.mkdtemp()
[task 2019-12-03T22:08:39.423Z] 0:35.69
[task 2019-12-03T22:08:39.423Z] 0:35.69 with mock.patch('mozdevice.adb.ADBDevice') as device:
[task 2019-12-03T22:08:39.424Z] 0:35.69 with mock.patch('raptor.raptor.RaptorControlServer') as control_server:
[task 2019-12-03T22:08:39.424Z] 0:35.69 # Override the shell output with sample CPU usage details
[task 2019-12-03T22:08:39.424Z] 0:35.69 filepath = os.path.abspath(os.path.dirname(file)) + '/files/'
[task 2019-12-03T22:08:39.424Z] 0:35.69 f = open(filepath + 'batterystats-android-7.txt', 'r')
[task 2019-12-03T22:08:39.425Z] 0:35.69 batterystats_return_value = f.read()
[task 2019-12-03T22:08:39.425Z] 0:35.69
[task 2019-12-03T22:08:39.425Z] 0:35.69 # Multiple shell output calls are performed
[task 2019-12-03T22:08:39.425Z] 0:35.69 # and only those with non-None output are required
[task 2019-12-03T22:08:39.425Z] 0:35.69 device.shell_output.return_value = None
[task 2019-12-03T22:08:39.425Z] 0:35.69 device.shell_output.side_effect = [
[task 2019-12-03T22:08:39.426Z] 0:35.69 None,
[task 2019-12-03T22:08:39.426Z] 0:35.69 None,
[task 2019-12-03T22:08:39.426Z] 0:35.69 'Test value',
[task 2019-12-03T22:08:39.426Z] 0:35.69 'Test value',
[task 2019-12-03T22:08:39.426Z] 0:35.69 batterystats_return_value,
[task 2019-12-03T22:08:39.426Z] 0:35.69 '7.0.0',
[task 2019-12-03T22:08:39.426Z] 0:35.69 ]
[task 2019-12-03T22:08:39.427Z] 0:35.69
[task 2019-12-03T22:08:39.427Z] 0:35.69 device._verbose = True
[task 2019-12-03T22:08:39.427Z] 0:35.69 device.version = 7
[task 2019-12-03T22:08:39.427Z] 0:35.69
[task 2019-12-03T22:08:39.427Z] 0:35.69 # Create a control server
[task 2019-12-03T22:08:39.427Z] 0:35.69 control_server.power_test = True
[task 2019-12-03T22:08:39.428Z] 0:35.69 control_server.test_name = 'gve-pytest'
[task 2019-12-03T22:08:39.428Z] 0:35.69 control_server.device = device
[task 2019-12-03T22:08:39.428Z] 0:35.69 control_server.app_name = 'org.mozilla.geckoview_example'
[task 2019-12-03T22:08:39.428Z] 0:35.69 > raptor = RaptorAndroid('geckoview', 'org.mozilla.geckoview_example', power_test=True)
[task 2019-12-03T22:08:39.428Z] 0:35.69
[task 2019-12-03T22:08:39.428Z] 0:35.69 testing/raptor/test/test_power.py:46:
[task 2019-12-03T22:08:39.428Z] 0:35.69 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2019-12-03T22:08:39.428Z] 0:35.69 testing/raptor/raptor/raptor.py:1284: in init
[task 2019-12-03T22:08:39.429Z] 0:35.69 super(RaptorAndroid, self).init(app, binary, profile_class="firefox", **kwargs)
[task 2019-12-03T22:08:39.429Z] 0:35.69 testing/raptor/raptor/raptor.py:842: in init
[task 2019-12-03T22:08:39.429Z] 0:35.69 super(Raptor, self).init(*args, **kwargs)
[task 2019-12-03T22:08:39.429Z] 0:35.69 testing/raptor/raptor/raptor.py:177: in init
[task 2019-12-03T22:08:39.429Z] 0:35.69 self.build_browser_profile()
[task 2019-12-03T22:08:39.429Z] 0:35.69 testing/raptor/raptor/raptor.py:1331: in build_browser_profile
[task 2019-12-03T22:08:39.429Z] 0:35.69 super(RaptorAndroid, self).build_browser_profile()
[task 2019-12-03T22:08:39.429Z] 0:35.69 testing/raptor/raptor/raptor.py:939: in build_browser_profile
[task 2019-12-03T22:08:39.429Z] 0:35.69 super(Raptor, self).build_browser_profile()
[task 2019-12-03T22:08:39.430Z] 0:35.69 testing/raptor/raptor/raptor.py:204: in build_browser_profile
[task 2019-12-03T22:08:39.430Z] 0:35.69 self.get_conditioned_profile()
[task 2019-12-03T22:08:39.430Z] 0:35.69 testing/raptor/raptor/raptor.py:188: in get_conditioned_profile
[task 2019-12-03T22:08:39.430Z] 0:35.69 cond_prof_target_dir = get_profile(temp_download_dir, platform, "cold")
[task 2019-12-03T22:08:39.430Z] 0:35.69 testing/condprofile/condprof/client.py:80: in get_profile
[task 2019-12-03T22:08:39.430Z] 0:35.69 size = len(list(tar))
[task 2019-12-03T22:08:39.430Z] 0:35.69 /usr/lib/python2.7/tarfile.py:2508: in next
[task 2019-12-03T22:08:39.430Z] 0:35.69 tarinfo = self.tarfile.next()
[task 2019-12-03T22:08:39.430Z] 0:35.69 /usr/lib/python2.7/tarfile.py:2348: in next
[task 2019-12-03T22:08:39.431Z] 0:35.69 self.fileobj.seek(self.offset - 1)
[task 2019-12-03T22:08:39.431Z] 0:35.69 /usr/lib/python2.7/gzip.py:443: in seek
[task 2019-12-03T22:08:39.431Z] 0:35.69 self.read(1024)
[task 2019-12-03T22:08:39.431Z] 0:35.69 /usr/lib/python2.7/gzip.py:268: in read
[task 2019-12-03T22:08:39.431Z] 0:35.69 self._read(readsize)
[task 2019-12-03T22:08:39.431Z] 0:35.69 /usr/lib/python2.7/gzip.py:315: in _read
[task 2019-12-03T22:08:39.431Z] 0:35.69 self._read_eof()
[task 2019-12-03T22:08:39.431Z] 0:35.69 /usr/lib/python2.7/gzip.py:350: in _read_eof
[task 2019-12-03T22:08:39.431Z] 0:35.69 crc32 = read32(self.fileobj)
[task 2019-12-03T22:08:39.432Z] 0:35.69 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2019-12-03T22:08:39.432Z] 0:35.69
[task 2019-12-03T22:08:39.432Z] 0:35.69 input = <closed file '/builds/worker/.condprof-cache/profile-linux64-cold-default.tgz', mode 'rb' at 0x7fbcc7efb6f0>
[task 2019-12-03T22:08:39.432Z] 0:35.70
[task 2019-12-03T22:08:39.432Z] 0:35.70 def read32(input):
[task 2019-12-03T22:08:39.432Z] 0:35.70 > return struct.unpack("<I", input.read(4))[0]
[task 2019-12-03T22:08:39.432Z] 0:35.70 E error: unpack requires a string argument of length 4
[task 2019-12-03T22:08:39.432Z] 0:35.70
[task 2019-12-03T22:08:39.432Z] 0:35.70 /usr/lib/python2.7/gzip.py:25: error
[task 2019-12-03T22:08:39.433Z] 0:35.70 ----------------------------- Captured stdout call -----------------------------
[task 2019-12-03T22:08:39.433Z] 0:35.70 Getting https://index.taskcluster.net/v1/task/gecko.v2.try.latest.firefox.condprof-linux64/artifacts/public/condprof/profile-linux64-cold-default.tgz
[task 2019-12-03T22:08:39.433Z] 0:35.70 [2019-12-03T22:08:33.909010] Downloading https://index.taskcluster.net/v1/task/gecko.v2.try.latest.firefox.condprof-linux64/artifacts/public/condprof/profile-linux64-cold-default.tgz
[task 2019-12-03T22:08:39.433Z] 0:35.70 Extracting the tarball content in /tmp/tmpdGuT0F
[task 2019-12-03T22:08:39.433Z] 0:35.70 ====================== 1 failed, 2 passed in 6.67 seconds ======================

Summary: Make Android temporarily use on-the-fly generated profiles, rather than conditioned ones, until we add support for them → [unittest] test_android7_power - Make Android temporarily use on-the-fly generated profiles, rather than conditioned ones, until we add support for them
Priority: -- → P1

Folded this into bug 1600838, with help from Tarek and Greg; not an in-tree bug itself to fix (just my code) - marking WONTFIX.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.