Backed out 8 changesets (bug 1696531) for test_dmd.js and test_subprocess.js xpc failures CLOSED TREE

Backed out changeset 907102743c5f (bug 1696531)
Backed out changeset c631966a64c0 (bug 1696531)
Backed out changeset 754ce2bf288a (bug 1696531)
Backed out changeset 7129c9cfe519 (bug 1696531)
Backed out changeset dba2bea61b29 (bug 1696531)
Backed out changeset 33f3e86a5ce8 (bug 1696531)
Backed out changeset 7dcbb17a1578 (bug 1696531)
Backed out changeset 1f982303513f (bug 1696531)
This commit is contained in:
Bogdan Tara 2021-04-14 17:49:29 +03:00
Родитель 101cb3c877
Коммит 4de76f4cdf
11 изменённых файлов: 54 добавлений и 69 удалений

Просмотреть файл

@ -10,14 +10,14 @@ A fake ADB binary
from __future__ import absolute_import from __future__ import absolute_import
import os import os
import socketserver import SocketServer
import sys import sys
HOST = "127.0.0.1" HOST = "127.0.0.1"
PORT = 5037 PORT = 5037
class ADBRequestHandler(socketserver.BaseRequestHandler): class ADBRequestHandler(SocketServer.BaseRequestHandler):
def sendData(self, data): def sendData(self, data):
header = "OKAY%04x" % len(data) header = "OKAY%04x" % len(data)
all_data = header + data all_data = header + data
@ -28,12 +28,12 @@ class ADBRequestHandler(socketserver.BaseRequestHandler):
# client is on heavy load (e.g. MOZ_CHAOSMODE) we can't send the whole # client is on heavy load (e.g. MOZ_CHAOSMODE) we can't send the whole
# data at once. # data at once.
while sent_length < total_length: while sent_length < total_length:
sent = self.request.send(all_data[sent_length:].encode("utf-8", "replace")) sent = self.request.send(all_data[sent_length:])
sent_length = sent_length + sent sent_length = sent_length + sent
def handle(self): def handle(self):
while True: while True:
data = self.request.recv(4096).decode("utf-8", "replace") data = self.request.recv(4096)
if "host:kill" in data: if "host:kill" in data:
self.sendData("") self.sendData("")
# Implicitly close all open sockets by exiting the program. # Implicitly close all open sockets by exiting the program.
@ -50,11 +50,11 @@ class ADBRequestHandler(socketserver.BaseRequestHandler):
break break
class ADBServer(socketserver.TCPServer): class ADBServer(SocketServer.TCPServer):
def __init__(self, server_address): def __init__(self, server_address):
# Create a socketserver with bind_and_activate 'False' to set # Create a SocketServer with bind_and_activate 'False' to set
# allow_reuse_address before binding. # allow_reuse_address before binding.
socketserver.TCPServer.__init__( SocketServer.TCPServer.__init__(
self, server_address, ADBRequestHandler, bind_and_activate=False self, server_address, ADBRequestHandler, bind_and_activate=False
) )

Просмотреть файл

@ -1,4 +1,4 @@
#! /usr/bin/env python3 #! /usr/bin/env python
# #
# This Source Code Form is subject to the terms of the Mozilla Public # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
@ -11,7 +11,6 @@ from __future__ import absolute_import, print_function, division
import argparse import argparse
import collections import collections
import gzip import gzip
import io
import json import json
import os import os
import platform import platform
@ -20,7 +19,6 @@ import shutil
import sys import sys
import tempfile import tempfile
from bisect import bisect_right from bisect import bisect_right
from functools import cmp_to_key
# The DMD output version this script handles. # The DMD output version this script handles.
outputVersion = 5 outputVersion = 5
@ -52,10 +50,6 @@ allocatorFns = [
] ]
def cmp(a, b):
return (a > b) - (a < b)
class Record(object): class Record(object):
"""A record is an aggregation of heap blocks that have identical stack """A record is an aggregation of heap blocks that have identical stack
traces. It can also be used to represent the difference between two traces. It can also be used to represent the difference between two
@ -286,7 +280,7 @@ def fixStackTraces(inputFilename, isZipped, opener):
# get that now in order to move |tmpFile| at the end. # get that now in order to move |tmpFile| at the end.
tmpFilename = tmpFile.name tmpFilename = tmpFile.name
if isZipped: if isZipped:
tmpFile = gzip.GzipFile(filename="", fileobj=tmpFile, mode="wb") tmpFile = gzip.GzipFile(filename="", fileobj=tmpFile)
with opener(inputFilename, "rb") as inputFile: with opener(inputFilename, "rb") as inputFile:
for line in inputFile: for line in inputFile:
@ -361,7 +355,7 @@ def getDigestFromFile(args, inputFile):
# Trim the number of frames. # Trim the number of frames.
for traceKey, frameKeys in traceTable.items(): for traceKey, frameKeys in traceTable.items():
if len(frameKeys) > args.max_frames: if len(frameKeys) > args.max_frames:
del frameKeys[args.max_frames :] traceTable[traceKey] = frameKeys[: args.max_frames]
def buildTraceDescription(traceTable, frameTable, traceKey): def buildTraceDescription(traceTable, frameTable, traceKey):
frameKeys = traceTable[traceKey] frameKeys = traceTable[traceKey]
@ -450,7 +444,7 @@ def getDigestFromFile(args, inputFile):
return recordKeyPartCache[traceKey] return recordKeyPartCache[traceKey]
recordKeyPart = str( recordKeyPart = str(
list(map(lambda frameKey: frameTable[frameKey], traceTable[traceKey])) map(lambda frameKey: frameTable[frameKey], traceTable[traceKey])
) )
recordKeyPartCache[traceKey] = recordKeyPart recordKeyPartCache[traceKey] = recordKeyPart
return recordKeyPart return recordKeyPart
@ -506,7 +500,7 @@ def getDigestFromFile(args, inputFile):
def f(k): def f(k):
return buildTraceDescription(traceTable, frameTable, k) return buildTraceDescription(traceTable, frameTable, k)
record.reportedAtDescs = list(map(f, reportedAtTraceKeys)) record.reportedAtDescs = map(f, reportedAtTraceKeys)
record.usableSizes[usableSize] += num record.usableSizes[usableSize] += num
# All the processed data for a single DMD file is called a "digest". # All the processed data for a single DMD file is called a "digest".
@ -612,9 +606,7 @@ def printDigest(args, digest):
out(separator) out(separator)
numRecords = len(records) numRecords = len(records)
cmpRecords = sortByChoices[args.sort_by] cmpRecords = sortByChoices[args.sort_by]
sortedRecords = sorted( sortedRecords = sorted(records.values(), cmp=cmpRecords, reverse=True)
records.values(), key=cmp_to_key(cmpRecords), reverse=True
)
kindBlocks = 0 kindBlocks = 0
kindUsableSize = 0 kindUsableSize = 0
maxRecord = 1000 maxRecord = 1000
@ -821,7 +813,7 @@ def prettyPrintDmdJson(out, j):
out.write(' "traceTable": {') out.write(' "traceTable": {')
first = True first = True
for k, l in j["traceTable"].items(): for k, l in j["traceTable"].iteritems():
out.write("" if first else ",") out.write("" if first else ",")
out.write('\n "{0}": {1}'.format(k, json.dumps(l))) out.write('\n "{0}": {1}'.format(k, json.dumps(l)))
first = False first = False
@ -829,7 +821,7 @@ def prettyPrintDmdJson(out, j):
out.write(' "frameTable": {') out.write(' "frameTable": {')
first = True first = True
for k, v in j["frameTable"].items(): for k, v in j["frameTable"].iteritems():
out.write("" if first else ",") out.write("" if first else ",")
out.write('\n "{0}": {1}'.format(k, json.dumps(v))) out.write('\n "{0}": {1}'.format(k, json.dumps(v)))
first = False first = False
@ -991,8 +983,8 @@ def clampBlockList(args, inputFileName, isZipped, opener):
tmpFile = tempfile.NamedTemporaryFile(delete=False) tmpFile = tempfile.NamedTemporaryFile(delete=False)
tmpFilename = tmpFile.name tmpFilename = tmpFile.name
if isZipped: if isZipped:
tmpFile = gzip.GzipFile(filename="", fileobj=tmpFile, mode="wb") tmpFile = gzip.GzipFile(filename="", fileobj=tmpFile)
prettyPrintDmdJson(io.TextIOWrapper(tmpFile, encoding="utf-8"), j) prettyPrintDmdJson(tmpFile, j)
tmpFile.close() tmpFile.close()
shutil.move(tmpFilename, inputFileName) shutil.move(tmpFilename, inputFileName)

Просмотреть файл

@ -54,17 +54,7 @@ Live {
} }
Live { Live {
-2 blocks in heap block record 5 of 6 0 blocks in heap block record 5 of 6
0 bytes (0 requested / 0 slop)
Individual block sizes: 8,192 x 2; -4,096 x 4
-0.00% of the heap (100.00% cumulative)
Allocated at {
#01: B (B.cpp:99)
}
}
Live {
0 blocks in heap block record 6 of 6
0 bytes (0 requested / 0 slop) 0 bytes (0 requested / 0 slop)
Individual block sizes: 20,480; -16,384; -8,192; 4,096 Individual block sizes: 20,480; -16,384; -8,192; 4,096
-0.00% of the heap (100.00% cumulative) -0.00% of the heap (100.00% cumulative)
@ -73,6 +63,16 @@ Live {
} }
} }
Live {
-2 blocks in heap block record 6 of 6
0 bytes (0 requested / 0 slop)
Individual block sizes: 8,192 x 2; -4,096 x 4
-0.00% of the heap (100.00% cumulative)
Allocated at {
#01: B (B.cpp:99)
}
}
#----------------------------------------------------------------- #-----------------------------------------------------------------
Summary { Summary {

Двоичные данные
memory/replace/dmd/test/script-sort-by.json.gz

Двоичный файл не отображается.

Просмотреть файл

@ -217,7 +217,7 @@ function test_name_too_long() {
// Try creating a socket in a directory that doesn't exist. // Try creating a socket in a directory that doesn't exist.
function test_no_directory() { function test_no_directory() {
let socketName = do_get_tempdir(); let socketName = do_get_tempdir();
socketName.append("missing"); socketName.append("directory-that-does-not-exist");
socketName.append("socket"); socketName.append("socket");
do_check_throws_nsIException( do_check_throws_nsIException(

Просмотреть файл

@ -12,7 +12,6 @@ job-defaults:
by-test-platform: by-test-platform:
android-em-7.*: geckoview-androidTest.apk android-em-7.*: geckoview-androidTest.apk
default: null default: null
python-3: true
mozharness: mozharness:
script: script:
by-test-platform: by-test-platform:

Просмотреть файл

@ -651,10 +651,7 @@ class XPCShellTestThread(Thread):
def fix_text_output(self, line): def fix_text_output(self, line):
line = cleanup_encoding(line) line = cleanup_encoding(line)
if self.stack_fixer_function is not None: if self.stack_fixer_function is not None:
line = self.stack_fixer_function(line) return self.stack_fixer_function(line)
if isinstance(line, bytes):
line = line.decode("utf-8")
return line return line
def log_line(self, line): def log_line(self, line):

Просмотреть файл

@ -4,7 +4,7 @@
# http://creativecommons.org/publicdomain/zero/1.0/ # http://creativecommons.org/publicdomain/zero/1.0/
# #
from __future__ import absolute_import, print_function from __future__ import absolute_import
import mozinfo import mozinfo
import os import os
@ -138,7 +138,7 @@ add_test(function test_loop () {
}); });
""" """
PASSING_TEST_UNICODE = b""" PASSING_TEST_UNICODE = """
function run_test () { run_next_test(); } function run_test () { run_next_test(); }
add_test(function test_unicode_print () { add_test(function test_unicode_print () {
@ -483,7 +483,7 @@ class XPCShellTestsTests(unittest.TestCase):
os.environ.pop("MOZ_OBJDIR", None) os.environ.pop("MOZ_OBJDIR", None)
self.build_obj = MozbuildObject.from_environment() self.build_obj = MozbuildObject.from_environment()
objdir = self.build_obj.topobjdir objdir = self.build_obj.topobjdir.encode("utf-8")
self.testing_modules = os.path.join(objdir, "_tests", "modules") self.testing_modules = os.path.join(objdir, "_tests", "modules")
if mozinfo.isMac: if mozinfo.isMac:
@ -518,13 +518,13 @@ class XPCShellTestsTests(unittest.TestCase):
shutil.rmtree(self.tempdir) shutil.rmtree(self.tempdir)
self.x.shutdownNode() self.x.shutdownNode()
def writeFile(self, name, contents, mode="w"): def writeFile(self, name, contents):
""" """
Write |contents| to a file named |name| in the temp directory, Write |contents| to a file named |name| in the temp directory,
and return the full path to the file. and return the full path to the file.
""" """
fullpath = os.path.join(self.tempdir, name) fullpath = os.path.join(self.tempdir, name)
with open(fullpath, mode) as f: with open(fullpath, "w") as f:
f.write(contents) f.write(contents)
return fullpath return fullpath
@ -895,7 +895,7 @@ add_test({
""" """
Check that passing unicode characters through an assertion method works. Check that passing unicode characters through an assertion method works.
""" """
self.writeFile("test_unicode_assert.js", PASSING_TEST_UNICODE, mode="wb") self.writeFile("test_unicode_assert.js", PASSING_TEST_UNICODE)
self.writeManifest(["test_unicode_assert.js"]) self.writeManifest(["test_unicode_assert.js"])
self.assertTestResult(True, verbose=True) self.assertTestResult(True, verbose=True)

Просмотреть файл

@ -1,4 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python2
from __future__ import print_function
import os import os
import signal import signal
@ -6,18 +7,15 @@ import struct
import sys import sys
def output(line, stream=sys.stdout, print_only=False): def output(line):
if isinstance(line, str): sys.stdout.write(struct.pack("@I", len(line)))
line = line.encode("utf-8", "surrogateescape") sys.stdout.write(line)
if not print_only: sys.stdout.flush()
stream.buffer.write(struct.pack("@I", len(line)))
stream.buffer.write(line)
stream.flush()
def echo_loop(): def echo_loop():
while True: while True:
line = sys.stdin.buffer.readline() line = sys.stdin.readline()
if not line: if not line:
break break
@ -55,5 +53,5 @@ elif cmd == "ignore_sigterm":
time.sleep(3600) time.sleep(3600)
elif cmd == "print": elif cmd == "print":
output(sys.argv[2], stream=sys.stdout, print_only=True) sys.stdout.write(sys.argv[2])
output(sys.argv[3], stream=sys.stderr, print_only=True) sys.stderr.write(sys.argv[3])

Просмотреть файл

@ -693,7 +693,6 @@ add_task(async function test_subprocess_environment() {
Object.assign(environment, { Object.assign(environment, {
PATH: env.get("PATH"), PATH: env.get("PATH"),
PATHEXT: env.get("PATHEXT"), PATHEXT: env.get("PATHEXT"),
SYSTEMROOT: env.get("SYSTEMROOT"),
}); });
} }

Просмотреть файл

@ -1,4 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/python
# vim:sw=4:ts=4:et: # vim:sw=4:ts=4:et:
# This Source Code Form is subject to the terms of the Mozilla Public # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
@ -15,6 +15,8 @@ import platform
import re import re
import sys import sys
import six
# Matches lines produced by MozFormatCodeAddress(), e.g. # Matches lines produced by MozFormatCodeAddress(), e.g.
# `#01: ???[tests/example +0x43a0]`. # `#01: ???[tests/example +0x43a0]`.
line_re = re.compile("#\d+: .+\[.+ \+0x[0-9A-Fa-f]+\]") line_re = re.compile("#\d+: .+\[.+ \+0x[0-9A-Fa-f]+\]")
@ -74,8 +76,9 @@ def fixSymbols(
line, jsonMode=False, slowWarning=False, breakpadSymsDir=None, hide_errors=False line, jsonMode=False, slowWarning=False, breakpadSymsDir=None, hide_errors=False
): ):
line_str = line.decode("utf-8") if isinstance(line, bytes) else line line = six.ensure_str(line)
if line_re.search(line_str) is None: result = line_re.search(line)
if result is None:
return line return line
if not fix_stacks: if not fix_stacks:
@ -85,17 +88,14 @@ def fixSymbols(
# to `fix-stacks` it will wait until it receives a newline, causing this # to `fix-stacks` it will wait until it receives a newline, causing this
# script to hang. So we add a newline if one is missing and then remove it # script to hang. So we add a newline if one is missing and then remove it
# from the output. # from the output.
is_missing_newline = not line_str.endswith("\n") is_missing_newline = not line.endswith("\n")
if is_missing_newline: if is_missing_newline:
line_str = line_str + "\n" line = line + "\n"
fix_stacks.stdin.write(line_str) fix_stacks.stdin.write(line)
fix_stacks.stdin.flush() fix_stacks.stdin.flush()
out = fix_stacks.stdout.readline() out = fix_stacks.stdout.readline()
if is_missing_newline: if is_missing_newline:
out = out[:-1] out = out[:-1]
if not isinstance(out, bytes):
out = out.encode("utf-8")
return out return out