Skip to content

Commit f5c68a3

Browse files
committed
deps: V8: cherry-pick f09dde9fbb54
Original commit message: Revert "[resultdb] Add ResultDB indicator" This reverts commit 237de893e1c0a0628a57d0f5797483d3add7f005. Reason for revert: breaks flake bisect: https://ci.chromium.org/ui/p/v8/builders/try.triggered/v8_flako/b8800423657665797553/overview The change added the implicit requirement to run testing with vpython3, which is not given everywhere. Original change's description: > [resultdb] Add ResultDB indicator > > Adds a new indicator that will send every result to ResultDB (and ultimately in a bq table; to be configured later). > > If we are not running in a ResultDB context we introduce only a minimal overhead by exiting early from indicator. > > To test these changes in a luci context with ResultDB we activated resultdb feature flag via V8-Recipe-Flags. This feature got implemented in https://crrev.com/c/3925576 . > > > V8-Recipe-Flags: resultdb > Bug: v8:13316 > Change-Id: I5d98e8f27531b536686a8d63b993313b9d6f62c5 > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3905385 > Commit-Queue: Liviu Rau <liviurau@google.com> > Reviewed-by: Alexander Schulze <alexschulze@chromium.org> > Cr-Commit-Position: refs/heads/main@{#83672} Bug: v8:13316 Change-Id: I7e55668e365475298ed46d2fc8ee0fe1282c3e8e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3952131 Auto-Submit: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#83677} Refs: v8/v8@f09dde9
1 parent a84c2c5 commit f5c68a3

File tree

8 files changed

+47
-192
lines changed

8 files changed

+47
-192
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.12',
39+
'v8_embedder_string': '-node.13',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/.vpython3

-5
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,3 @@ wheel: <
7474
name: "infra/python/wheels/protobuf-py3"
7575
version: "version:3.19.3"
7676
>
77-
78-
wheel: <
79-
name: "infra/python/wheels/requests-py2_py3"
80-
version: "version:2.13.0"
81-
>

deps/v8/tools/testrunner/objects/testcase.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,8 @@ def cmp(x, y):
447447
(other.suite.name, other.name, other.variant)
448448
)
449449

450-
@property
451-
def full_name(self):
452-
return self.suite.name + '/' + self.name
453-
454450
def __str__(self):
455-
return self.full_name
451+
return self.suite.name + '/' + self.name
456452

457453

458454
class D8TestCase(TestCase):

deps/v8/tools/testrunner/testproc/indicators.py

+44-38
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def print_failure_header(test, is_flaky=False):
17-
text = [test.full_name]
17+
text = [str(test)]
1818
if test.output_proc.negative:
1919
text.append('[negative]')
2020
if is_flaky:
@@ -24,23 +24,6 @@ def print_failure_header(test, is_flaky=False):
2424
print(output.encode(encoding, errors='replace').decode(encoding))
2525

2626

27-
def formatted_result_output(result):
28-
lines = []
29-
if result.output.stderr:
30-
lines.append("--- stderr ---")
31-
lines.append(result.output.stderr.strip())
32-
if result.output.stdout:
33-
lines.append("--- stdout ---")
34-
lines.append(result.output.stdout.strip())
35-
lines.append("Command: %s" % result.cmd.to_string())
36-
if result.output.HasCrashed():
37-
lines.append("exit code: %s" % result.output.exit_code_string)
38-
lines.append("--- CRASHED ---")
39-
if result.output.HasTimedOut():
40-
lines.append("--- TIMEOUT ---")
41-
return '\n'.join(lines)
42-
43-
4427
class ProgressIndicator():
4528

4629
def __init__(self, context, options, test_count):
@@ -85,7 +68,19 @@ def finished(self):
8568
for test, result, is_flaky in self._failed:
8669
flaky += int(is_flaky)
8770
print_failure_header(test, is_flaky=is_flaky)
88-
print(formatted_result_output(result))
71+
if result.output.stderr:
72+
print("--- stderr ---")
73+
print(result.output.stderr.strip())
74+
if result.output.stdout:
75+
print("--- stdout ---")
76+
print(result.output.stdout.strip())
77+
print("Command: %s" % result.cmd.to_string())
78+
if result.output.HasCrashed():
79+
print("exit code: %s" % result.output.exit_code_string)
80+
print("--- CRASHED ---")
81+
crashed += 1
82+
if result.output.HasTimedOut():
83+
print("--- TIMEOUT ---")
8984
if len(self._failed) == 0:
9085
print("===")
9186
print("=== All tests succeeded")
@@ -235,7 +230,7 @@ def on_test_result(self, test, result):
235230
else:
236231
self._passed += 1
237232

238-
self._print_progress(test.full_name)
233+
self._print_progress(str(test))
239234
if result.has_unexpected_output:
240235
output = result.output
241236
stdout = output.stdout.strip()
@@ -363,7 +358,10 @@ def __init__(self, context, options, test_count, framework_name):
363358
self.test_count = 0
364359

365360
def on_test_result(self, test, result):
366-
self.process_results(test, result.as_list)
361+
if result.is_rerun:
362+
self.process_results(test, result.results)
363+
else:
364+
self.process_results(test, [result])
367365

368366
def process_results(self, test, results):
369367
for run, result in enumerate(results):
@@ -378,7 +376,7 @@ def process_results(self, test, results):
378376
if not result.has_unexpected_output and run == 0:
379377
continue
380378

381-
record = self._test_record(test, result, run)
379+
record = self._test_record(test, result, output, run)
382380
record.update({
383381
"result": test.output_proc.get_outcome(output),
384382
"stdout": output.stdout,
@@ -394,33 +392,41 @@ def result_value(test, result, output):
394392
return ""
395393
return test.output_proc.get_outcome(output)
396394

397-
record = self._test_record(test, result, run)
398-
record.update(
399-
result=result_value(test, result, output),
400-
marked_slow=test.is_slow,
401-
)
395+
record = self._test_record(test, result, output, run)
396+
record.update({
397+
"result": result_value(test, result, output),
398+
"marked_slow": test.is_slow,
399+
})
402400
self.tests.add(record)
403401
self.duration_sum += record['duration']
404402
self.test_count += 1
405403

406-
def _test_record(self, test, result, run):
407-
record = util.base_test_record(test, result, run)
408-
record.update(
409-
framework_name=self.framework_name,
410-
command=result.cmd.to_string(relative=True),
411-
)
412-
return record
404+
def _test_record(self, test, result, output, run):
405+
return {
406+
"name": str(test),
407+
"flags": result.cmd.args,
408+
"command": result.cmd.to_string(relative=True),
409+
"run": run + 1,
410+
"exit_code": output.exit_code,
411+
"expected": test.expected_outcomes,
412+
"duration": output.duration,
413+
"random_seed": test.random_seed,
414+
"target_name": test.get_shell(),
415+
"variant": test.variant,
416+
"variant_flags": test.variant_flags,
417+
"framework_name": self.framework_name,
418+
}
413419

414420
def finished(self):
415421
duration_mean = None
416422
if self.test_count:
417423
duration_mean = self.duration_sum / self.test_count
418424

419425
result = {
420-
'results': self.results,
421-
'slowest_tests': self.tests.as_list(),
422-
'duration_mean': duration_mean,
423-
'test_total': self.test_count,
426+
"results": self.results,
427+
"slowest_tests": self.tests.as_list(),
428+
"duration_mean": duration_mean,
429+
"test_total": self.test_count,
424430
}
425431

426432
with open(self.options.json_test_results, "w") as f:

deps/v8/tools/testrunner/testproc/progress.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from . import base
77
from testrunner.local import utils
88
from testrunner.testproc.indicators import JsonTestProgressIndicator, PROGRESS_INDICATORS
9-
from testrunner.testproc.resultdb import ResultDBIndicator
109

1110

1211
class ResultsTracker(base.TestProcObserver):
@@ -67,7 +66,7 @@ def __init__(self, context, options, framework_name, test_count):
6766
0,
6867
JsonTestProgressIndicator(context, options, test_count,
6968
framework_name))
70-
self.procs.append(ResultDBIndicator(context, options, test_count))
69+
7170
self._requirement = max(proc._requirement for proc in self.procs)
7271

7372
def _on_result_for(self, test, result):

deps/v8/tools/testrunner/testproc/result.py

-8
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ def is_grouped(self):
1616
def is_rerun(self):
1717
return False
1818

19-
@property
20-
def as_list(self):
21-
return [self]
22-
2319

2420
class Result(ResultBase):
2521
"""Result created by the output processor."""
@@ -116,9 +112,5 @@ def __init__(self, results):
116112
def is_rerun(self):
117113
return True
118114

119-
@property
120-
def as_list(self):
121-
return self.results
122-
123115
def status(self):
124116
return ' '.join(r.status() for r in self.results)

deps/v8/tools/testrunner/testproc/resultdb.py

-95
This file was deleted.

deps/v8/tools/testrunner/testproc/util.py

-38
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import logging
88
import os
99
import platform
10-
import re
1110
import signal
1211
import subprocess
1312

@@ -54,43 +53,6 @@ def kill_processes_linux():
5453
logging.exception('Failed to kill process')
5554

5655

57-
def strip_ascii_control_characters(unicode_string):
58-
return re.sub(r'[^\x20-\x7E]', '?', str(unicode_string))
59-
60-
61-
def base_test_record(test, result, run):
62-
record = {
63-
'name': test.full_name,
64-
'flags': result.cmd.args,
65-
'run': run + 1,
66-
'expected': test.expected_outcomes,
67-
'random_seed': test.random_seed,
68-
'target_name': test.get_shell(),
69-
'variant': test.variant,
70-
'variant_flags': test.variant_flags,
71-
}
72-
if result.output:
73-
record.update(
74-
exit_code=result.output.exit_code,
75-
duration=result.output.duration,
76-
)
77-
return record
78-
79-
80-
def extract_tags(record):
81-
tags = []
82-
for k, v in record.items():
83-
if type(v) == list:
84-
tags += [sanitized_kv_dict(k, e) for e in v]
85-
else:
86-
tags.append(sanitized_kv_dict(k, v))
87-
return tags
88-
89-
90-
def sanitized_kv_dict(k, v):
91-
return dict(key=k, value=strip_ascii_control_characters(v))
92-
93-
9456
class FixedSizeTopList():
9557
"""Utility collection for gathering a fixed number of elements with the
9658
biggest value for the given key. It employs a heap from which we pop the

0 commit comments

Comments
 (0)