0
Commit Graph

83 Commits

Author SHA1 Message Date
Joshua Hood
3fade1f647 Reland "[CodeHealth] Migrate remainder of testing/ to Python3 compatible
syntax"

This is a reland of commit 8defc6c6da

Uses `sys.path.append(...)` to import the `common` module in
testing/scripts/run_variations_smoke_tests.py (as is done elsewhere in
the original CL) and resolve errors thrown for attempting a relative
import with no known parent package.

Original change's description:
>and Pylint2.7, and fix resulting errors.
>
>Bug: 1262363
>Change-Id: I09628427dd4caf9d873f3b489b897054430f8567
>Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557490
>Reviewed-by: Ben Pastene <bpastene@chromium.org>
>Commit-Queue: Joshua Hood <jdh@chromium.org>
>Cr-Commit-Position: refs/heads/main@{#996200}

Bug: 1262363
Change-Id: I60fe062f62962d0b3dc4e93d9e29626ed181f688
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3610783
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Joshua Hood <jdh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999432}
2022-05-04 16:00:42 +00:00
Sebastien Lalancette
53ef7d3a9b Revert "[CodeHealth] Migrate remainder of testing/ to Python3 compatible syntax"
This reverts commit 8defc6c6da.

Reason for revert: Makes win-chrome fail:
https://ci.chromium.org/p/chrome/builders/try/win-chrome/4538

Original change's description:
> [CodeHealth] Migrate remainder of testing/ to Python3 compatible syntax
>
> and Pylint2.7, and fix resulting errors.
>
> Bug: 1262363
> Change-Id: I09628427dd4caf9d873f3b489b897054430f8567
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557490
> Reviewed-by: Ben Pastene <bpastene@chromium.org>
> Commit-Queue: Joshua Hood <jdh@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#996200}

Bug: 1262363
Change-Id: I74384a8cbd77e0db5adbbd5815d54e836472b756
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3607233
Auto-Submit: Sebastien Lalancette <seblalancette@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#996362}
2022-04-26 20:53:45 +00:00
Joshua Hood
8defc6c6da [CodeHealth] Migrate remainder of testing/ to Python3 compatible syntax
and Pylint2.7, and fix resulting errors.

Bug: 1262363
Change-Id: I09628427dd4caf9d873f3b489b897054430f8567
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557490
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Joshua Hood <jdh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#996200}
2022-04-26 15:35:06 +00:00
Dmitrii Shcherbinin
eff2440776 Small refactoring
1. Fix py23 compatibility
2. Redirect log messages to stderr. "print" uses buffers when
writes to stdout. Due to stdout buffering, messages from "print"
are written to log file in the last order and does not appear
in the place they are expected to be.
3. Delete unused imports

Change-Id: Ideb013ab96e24a192050de1a057f8abeb83ed27c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3595879
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Commit-Queue: Dmitry Shcherbinin <cher-di@yandex-team.ru>
Cr-Commit-Position: refs/heads/main@{#995691}
2022-04-25 17:41:29 +00:00
Daniel Cheng
232052154c Revert "Remove setting LPAC ACLs in test_env.py"
This reverts commit 98156590a1.

Reason for revert: win10_chromium_x64_rel_ng trybot appears unhappy

Original change's description:
> Remove setting LPAC ACLs in test_env.py
>
> This is no longer needed, as the bots have the right ACLs
> from the point of creation.
>
> This also means that the code can be moved back into
> build/win as it's only needed in one place.
>
> BUG=1307013,1191111
>
> Change-Id: Ib85c4fe4b460640048bbb353c54011816b581648
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3591875
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Ben Pastene <bpastene@chromium.org>
> Commit-Queue: Will Harris <wfh@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#993791}

Bug: 1307013,1191111
Bug: 1317857
Change-Id: Id6584e415d040b52fc70b296a1c4a3030a7da386
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3594298
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#993969}
2022-04-20 00:10:11 +00:00
Will Harris
98156590a1 Remove setting LPAC ACLs in test_env.py
This is no longer needed, as the bots have the right ACLs
from the point of creation.

This also means that the code can be moved back into
build/win as it's only needed in one place.

BUG=1307013,1191111

Change-Id: Ib85c4fe4b460640048bbb353c54011816b581648
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3591875
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#993791}
2022-04-19 18:03:22 +00:00
Weizhong Xia
c120b0ceb8 Add/fix log to debug leaked process issue.
Bug: 1226706
Change-Id: Ia62c9a0e96069749a5b7492fb742049bb2264768
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3301066
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Weizhong Xia <weizhong@google.com>
Cr-Commit-Position: refs/heads/main@{#946198}
2021-11-29 23:12:12 +00:00
Wenbin Zhang
e6fafcc34b [benchmarking] update shebang of run_performace_tests to default in vpython3
using decode() directly instead of six.

Bug: chromium:1252452
Change-Id: I00bed63cd112707b99892d021bd05f660912ca36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3290453
Auto-Submit: Wenbin Zhang <wenbinzhang@google.com>
Commit-Queue: Wenbin Zhang <wenbinzhang@google.com>
Reviewed-by: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942955}
2021-11-18 04:25:48 +00:00
Phillis Tang
826c02ff1a Revert "[benchmarking] update shebang of run_performace_tests to default in vpython3"
This reverts commit 3752b91013.

Reason for revert: causing compile error that leads to tree being closed. https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8830280739615832369/+/u/compile/stdout.

Original change's description:
> [benchmarking] update shebang of run_performace_tests to default in vpython3
>
> Update to default running run_performance_tests in python 3.
>
> Bug: chromium:1252452
> Change-Id: I624d0aa320c10e42f382815c30823f57195c9b91
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3288791
> Commit-Queue: Wenbin Zhang <wenbinzhang@google.com>
> Auto-Submit: Wenbin Zhang <wenbinzhang@google.com>
> Reviewed-by: John Chen <johnchen@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#942818}

Bug: chromium:1252452
Change-Id: Id8297b4115c080cd1d3f9f99bf4383cce9ad06ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Owners-Override: Phillis Tang <phillis@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3290365
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Phillis Tang <phillis@chromium.org>
Owners-Override: Phillis Tang <phillis@chromium.org>
Auto-Submit: Phillis Tang <phillis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942837}
2021-11-17 22:44:21 +00:00
Wenbin Zhang
3752b91013 [benchmarking] update shebang of run_performace_tests to default in vpython3
Update to default running run_performance_tests in python 3.

Bug: chromium:1252452
Change-Id: I624d0aa320c10e42f382815c30823f57195c9b91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3288791
Commit-Queue: Wenbin Zhang <wenbinzhang@google.com>
Auto-Submit: Wenbin Zhang <wenbinzhang@google.com>
Reviewed-by: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942818}
2021-11-17 21:31:37 +00:00
Kuan Huang
f4e199e55f test_env.py --skip-set-lpac-acls for tests doesn't depends on sandbox
set_lpac_acls is for correct LPAC (less privileged app container) sandbox of CAS cache hard linking files (crbug.com/1225029#c21). When running tests under the entire code directory, it could take ~90s to setup ACLs. For the tests that doesn't depends on sandbox, set_lpac_acls could be skipped.

Bug: 1266194
Change-Id: I8e5eb71230fb55083869d29d3edd7adb58caffef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3259239
Auto-Submit: Kuan Huang <kuanhuang@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/main@{#938560}
2021-11-04 22:53:11 +00:00
Roger Tawa
be725ea389 Add some logging to test_env.py on Windows.
crbug/1235878 seems to indicate that the test binaries are not starting
correctly.  This CL adds logging to test_env.py to print the return
code of the binary to help debug what might be failing.

Bug: 1235878
Change-Id: Ia1dd6c05d7b6563d8c124df9cc3a68de34bd623d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3245566
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/main@{#935393}
2021-10-27 12:47:53 +00:00
Kuan Huang
235b014112 add --coverage-continuous-mode=1 for test_env.py and enable for mac-code-coverage
Enabling a clang coverage mode that profile counter updates are continuously synced to a file. This will help reduce the coverage profile dumping overhead and reduce the corrupted issue when process killed or crashed.

[1] https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program

Bug: 1223230
Change-Id: Ib97e7e876d3380f8d4dc3179a99f81b75539971c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3179667
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Kuan Huang <kuanhuang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#933108}
2021-10-19 18:59:28 +00:00
Will Harris
bed6e6eefb Set LPAC permissions on hard linked files on bots.
The luci infrastructure uses a cache for some swarming files and
hard links from the cache to the test directory.

This causes the script that sets LPAC ACLs to not successfully
set the right ACLs on these files.

This addition to the set_lpac_acls function  means that, when
running as part of a test, these files are identified and
the correct ACL is written to them.

BUG=1225029

Change-Id: I35d89c83e906f6cc880908ec43d8a470c4bb8ae0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3075257
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#909114}
2021-08-05 23:36:09 +00:00
Nico Weber
9417be66ec mac/asan: Stop setting DYLD_LIBRARY_PATH when running asan tests
This shouldn't be necessary.

Bug: 454828
Change-Id: I480a3d09177f8ebce4cc8996bc55d78803d34a15
Cq-Include-Trybots: luci.chromium.try:mac_chromium_asan_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3001505
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#901709}
2021-07-14 23:56:07 +00:00
Greg Thompson
0c98a68458 Speculative fix for Windows test failures.
This change inserts //testing/scripts to the front of sys.path rather
than the end of it so that //testing/scripts/common.py is found by
"import common" rather than some other common.py that happens to be in
the path.

R=dpranke@google.com

Bug: 1215025
Change-Id: Ibbbfd4d032b1e5061fac40bdf0cb51297aa6d866
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2940526
Auto-Submit: Greg Thompson <grt@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#889541}
2021-06-05 03:30:44 +00:00
John Palmer
a8515fcac9 [COIL] Change chromium code search type links to use main rather than master for testing
See this doc: go/chromium-coil-change for more info
    BUG=1210385

Change-Id: I646cf6ac1125b021b2dd84cdf2fee30958fd8a92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2902983
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: John Palmer <jopalmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884847}
2021-05-20 03:35:32 +00:00
Ben Pastene
536f57c0fd Disable intercept_tls_get_addr for LSan tests on linux.
https://github.com/google/sanitizers/issues/1322

According to that github issue, lsan will mistakenly detect "2.19 for
the real glibc of version 2.25 or higher."

On our xenial test bots, /lib/x86_64-linux-gnu/libc.so.6 is 2.23. On
our bionic test bots, libc is 2.27. So when we switched our asan/lsan
tests to bionic, we started hitting strange lsan errors:

Tracer caught signal 11: addr=0x330004f3 pc=0x55af5266644a sp=0x7f405e956d40
==28674==LeakSanitizer has encountered a fatal error.
eg: https://chromium-swarm.appspot.com/task?id=53745e69a9525810

It appears that error is the same reported in the github issue, as
disabling the DTLS check prevents those same LSan errors.

Though this doesn't entirely explain why the failures are transient
when nothing about the bots seemingly changes. eg:
https://ci.chromium.org/p/chromium/builders/ci/Linux%20ASan%20LSan%20Tests%20%281%29
Why does components_unittests fail in builds 89913 - 89916, but is
fine before and after?

Bug: 1200574
Change-Id: Id8ffed3bd50d648a1147de50bb4fd2f001c01d12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2888418
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Owners-Override: Garrett Beaty <gbeaty@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883698}
2021-05-17 23:21:56 +00:00
Will Harris
9e4cf31c36 Set app container ACLs for LPAC sandbox.
In order for binaries running under LPAC sandbox to operate they
need read access to their own files.

This change consists of two parts, the first part sets the ACL
when building a component that depends on sandbox (e.g. on a
developer workstation).

The second part sets the ACL when running tests as part of
running tests on a host where the build did not happen e.g.
as part of a swarming isolate or test infrastructure.

Note: on a full Chrome install, these ACLs are set by the
installer.

Add a test to sbox_integration_tests to verify this works.

BUG=1191111

Change-Id: I88d4e53cb11dbd52316cd1a605bce94518f62772
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2811185
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: James Forshaw <forshaw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874038}
2021-04-19 23:55:15 +00:00
Dirk Pranke
2b9bec7f13 Remove uses of six from test_env.py.
https://crrev.com/c/2229335 added a dependency on `six` from
test_env.py in order to try and make it compatible with both
Python 2 and Python 3. However, it got the path to the
//third_party version of six wrong, and so it actually only worked
if six was available otherwise in the Python install (which it is,
most of the time, these days).

The script didn't actually benefit much from six, though, so
rather than fix the import path, this CL just makes the code
2- and 3-compatible without needing six, and removes the dependency
instead.

Bug: 942720
Change-Id: I44e44772cea8d92eff10a5c59879ce4d05de8fcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2545924
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828587}
2020-11-18 04:33:38 +00:00
Bruce Dawson
6cf79f4968 Add informative python/vpython error message
When running blink web tests it is important to invoke the wrapper
script (run_isolated_script_test.py) with vpython or else psutil and six
will fail to import.

This change wraps the import of psutil and six in an exception handler
so that a useful error message can be printed. This should make it
easier for users to find the correct solution.

Change-Id: Ia2712e97790d8b54bb9cc640ace37a0fe01ce1c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495868
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820453}
2020-10-23 22:20:31 +00:00
Takuto Ikuta
61c9525c11 testing: revert whitespace change
This is revert of https://crrev.com/c/2337833 , but remove unused
import too.

Bug: 1112996
Change-Id: Id0370a6e321b861a27e6415702934eb5f24d1ff5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336323
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795053}
2020-08-05 16:27:30 +00:00
Ben Pastene
a0a33bd331 Add a test_env.py no-op change to reset swarming's task duplication.
Current ios tasks are being de-duped into tasks with broken
isolated out dirs, eg:
https://ci.chromium.org/p/chromium/builders/ci/ios-simulator/56813

Adding a dummy change to test_env.py should reset that since this file
is added to every test. Adding no-try to fix CQ.

TBR=dpranke@google.com

No-Try: true
Bug: 1112996
Change-Id: I280d2a12e4f22ce76e8328aaba6e545ea04c1f00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2337833
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794818}
2020-08-05 02:13:56 +00:00
Chris McDonald
c3e0f26bef Make test_env compatible with python 2 & 3
Use the vendored copy of the `six` library to make this code work across
Python versions.

Bug: 942720
Change-Id: I4bdb1032ed8e89e733b929eb13ada54efeb3b019
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229335
Commit-Queue: Chris McDonald <cjmcdonald@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774934}
2020-06-04 02:15:14 +00:00
Ben Pastene
4568e17607 Revert "Add a whitespace change to test_env.py to reset swarming deduplication."
This reverts commit 320f9516ab.

Reason for revert: deduping was reset, comment no longer needed

Original change's description:
> Add a whitespace change to test_env.py to reset swarming deduplication.
> 
> Due to emergency server maintenance in crbug.com/1069091, we need all
> tests to not be deduplicated into tests that ran prior to the
> maintenance. Adding a trivial change to //testing/test_env.py will
> prevent any task deduplication since most every test includes this file
> in its inputs.
> 
> TBR=johnchen
> 
> No-Try: true
> No-Tree-Checks: true
> Bug: 1069091
> Change-Id: If99af96b6bce7b00cd982de0234b39dbb9a9ec89
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2142619
> Commit-Queue: Ben Pastene <bpastene@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#757517}

TBR=iannucci@chromium.org,bpastene@chromium.org,johnchen@chromium.org

Change-Id: If0b620f3461efeef34ec7a0d24fcd813f585d00b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1069091
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144360
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757943}
2020-04-09 18:42:54 +00:00
Ben Pastene
320f9516ab Add a whitespace change to test_env.py to reset swarming deduplication.
Due to emergency server maintenance in crbug.com/1069091, we need all
tests to not be deduplicated into tests that ran prior to the
maintenance. Adding a trivial change to //testing/test_env.py will
prevent any task deduplication since most every test includes this file
in its inputs.

TBR=johnchen

No-Try: true
No-Tree-Checks: true
Bug: 1069091
Change-Id: If99af96b6bce7b00cd982de0234b39dbb9a9ec89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2142619
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757517}
2020-04-08 20:14:03 +00:00
Ben Pastene
04ee6c79b9 Force test_env.py's shebang to python2 on UNIX.
test_env.py isn't compatible with python3 due to dict.iteritem() calls,
and perhaps more. Consequently, when running the script via the shebang
on an environment that defaults to python3, the script will fail.

This fixes that by explicitly setting invocations of `./test_env.py` to
use the system's python2 (if it has one).

Bug: 942720
Change-Id: I6dc18b5fedace510c61628e88701e89410715ecb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068896
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743983}
2020-02-24 18:22:26 +00:00
Ilia Samsonov
4ea016768b Use symbolization script for any sanitizer.
https://codereview.chromium.org/2857643002 forced all sanitizers
builds to print address offsets only. This output is meant to run
through tools/valgrind/asan/asan_symbolize.py

yet test_env has different configuration to run through the asan_symbolize.py.

The asan and tsan builds for this cl give meaningful output.

Before,
Stack trace:
 0x55d1d54e8bc3 (/b/s/w/ir/out/Release/content_browsertests+0x1cf42bc2)
 0x55d1ccb003ab (/b/s/w/ir/out/Release/content_browsertests+0x1455a3aa)
 0x55d1ccb2b740 (/b/s/w/ir/out/Release/content_browsertests+0x1458573f)
 0x55d1ccb29747 (/b/s/w/ir/out/Release/content_browsertests+0x14583746)
 0x55d1c82f2530 (/b/s/w/ir/out/Release/content_browsertests+0xfd4c52f)
 0x55d1d40a8d42 (/b/s/w/ir/out/Release/content_browsertests+0x1bb02d41)
 0x55d1d4333e88 (/b/s/w/ir/out/Release/content_browsertests+0x1bd8de87)
 0x55d1d16f3fc2 (/b/s/w/ir/out/Release/content_browsertests+0x1914dfc1)
 0x55d1d2e62e79 (/b/s/w/ir/out/Release/content_browsertests+0x1a8bce78)
 0x55d1d16f0f65 (/b/s/w/ir/out/Release/content_browsertests+0x1914af64)
 0x55d1d16fb299 (/b/s/w/ir/out/Release/content_browsertests+0x19155298)
 0x55d1d16eb211 (/b/s/w/ir/out/Release/content_browsertests+0x19145210)
 0x55d1d1085a78 (/b/s/w/ir/out/Release/content_browsertests+0x18adfa77)
 0x55d1d1084d99 (/b/s/w/ir/out/Release/content_browsertests+0x18aded98)
 0x55d1dba2402c (/b/s/w/ir/out/Release/content_browsertests+0x2347e02b)

After,
Stack trace:
     0x562f0d54eee3 in StackTrace ./../../base/debug/stack_trace.cc:206:12
     0x562f0d54eee3 in base::debug::StackTrace::StackTrace() ./../../base/debug/stack_trace.cc:203:28
     0x562f051de24b in StackTraceGetter::CurrentStackTrace(int, int) ./../../third_party/googletest/custom/gtest/internal/custom/stack_trace_getter.cc:22:27
     0x562f051fdb40 in testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop(int) ./../../third_party/googletest/src/googletest/src/gtest.cc:820:35
     0x562f051fc527 in testing::internal::AssertHelper::operator=(testing::Message const&) const ./../../third_party/googletest/src/googletest/src/gtest.cc:401:25
     0x562f0127b36b in content::PointerLockBrowserTest_PointerLockWheelEventRouting_Test::RunTestOnMainThread() ./../../content/browser/pointer_lock_browsertest.cc:518:5
     0x562f0c30fba6 in content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() ./../../content/public/test/browser_test_base.cc:656:5
     0x562f0c54407b in Run ./../../base/callback.h:132:12
     0x562f0c54407b in content::ShellBrowserMainParts::PreMainMessageLoopRun() ./../../content/shell/browser/shell_browser_main_parts.cc:168:26
     0x562f09b284d2 in content::BrowserMainLoop::PreMainMessageLoopRun() ./../../content/browser/browser_main_loop.cc:1031:13
     0x562f0b1a6839 in Run ./../../base/callback.h:98:12
     0x562f0b1a6839 in content::StartupTaskRunner::RunAllTasksNow() ./../../content/browser/startup_task_runner.cc:41:29
     0x562f09b25475 in content::BrowserMainLoop::CreateStartupTasks() ./../../content/browser/browser_main_loop.cc:940:25
     0x562f09b2f519 in content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) ./../../content/browser/browser_main_runner_impl.cc:128:15
     0x562f09b1f61f in content::BrowserMain(content::MainFunctionParams const&) ./../../content/browser/browser_main.cc:43:32
     0x562f0959b1e8 in RunBrowserProcessMain ./../../content/app/content_main_runner_impl.cc:527:10
     0x562f0959b1e8 in content::ContentMainRunnerImpl::RunServiceManager(content::MainFunctionParams&, bool) ./../../content/app/content_main_runner_impl.cc:960:10
     0x562f0959a50d in content::ContentMainRunnerImpl::Run(bool) ./../../content/app/content_main_runner_impl.cc:868:12
     0x562f1327ce25 in service_manager::Main(service_manager::MainParams const&) ./../../services/service_manager/embedder/main.cc:423:29


Bug: 877205
Change-Id: Ib83c3e72919f0d1664cd2e2d338cbd21982d1c0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894762
Reviewed-by: Alexander Potapenko <glider@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Ilia Samsonov <isamsonov@google.com>
Cr-Commit-Position: refs/heads/master@{#720662}
2019-12-02 22:11:13 +00:00
Sorin Jianu
e11c98574b Revert "Make test_env.py compatible w/ Python 3"
This reverts commit 1102f12d8e.

Reason for revert: it is breaking stuff on several Mac bots.

[E2019-09-12T12:28:01.848585-07:00 31162 0 annotate.go:241] goroutine 1:
[E2019-09-12T12:28:01.848653-07:00 31162 0 annotate.go:241]  go.chromium.org/luci/vpython/python/find.go:93 - python.Find()
[E2019-09-12T12:28:01.848672-07:00 31162 0 annotate.go:241]   annotation :
[E2019-09-12T12:28:01.848683-07:00 31162 0 annotate.go:241]     reason: no Python found
[E2019-09-12T12:28:01.848692-07:00 31162 0 annotate.go:241]   annotation :
[E2019-09-12T12:28:01.848701-07:00 31162 0 annotate.go:241]     reason: could not find appropriate executable for: "python3.8"
[E2019-09-12T12:28:01.848709-07:00 31162 0 annotate.go:241]   annotation :
[E2019-09-12T12:28:01.848725-07:00 31162 0 annotate.go:241]     reason: could not find target in system
[E2019-09-12T12:28:01.848739-07:00 31162 0 annotate.go:241]     internal reason: target(python3.8)/dirs([/b/s/w/ir/.swarming_module /b/s/w/ir/.swarming_module/cpython/bin /b/s/w/ir/.swarming_module/cpython3/bin /b/s/cipd_cache/bin /opt/local/bin /opt/local/sbin /usr/local/sbin /usr/local/git/bin /usr/local/bin /usr/sbin /usr/bin /sbin /bin])
[E2019-09-12T12:28:01.848764-07:00 31162 0 annotate.go:241] 
[E2019-09-12T12:28:01.848774-07:00 31162 0 annotate.go:241]  go.chromium.org/luci/vpython/venv/config.go:272 - venv.(*Config).resolvePythonInterpreter()
[E2019-09-12T12:28:01.848785-07:00 31162 0 annotate.go:241]   reason: could not find Python for: 3.8.0
[E2019-09-12T12:28:01.848799-07:00 31162 0 annotate.go:241] 
[E2019-09-12T12:28:01.848808-07:00 31162 0 annotate.go:241]  go.chromium.org/luci/vpython/venv/config.go:187 - venv.(*Config).makeEnv()
[E2019-09-12T12:28:01.848822-07:00 31162 0 annotate.go:241]   reason: failed to resolve system Python interpreter
Original change's description:
> Make test_env.py compatible w/ Python 3
> 
> Makes test_env.py compatible with both Python 2 and 3. Also adds a very
> simple test to ensure that it remains compatible until some other test
> switches to Python 3.
> 
> As a side effect of adding the test, also makes
> testing/scripts/common.py compatible with Python 3 since it's
> necessary for running isolated scripts.
> 
> Bug: 898348
> Change-Id: Ib58cf4c4f85df60a432764d7f744bc3fee09ae3a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796525
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#695825}

TBR=dpranke@chromium.org,bsheedy@chromium.org

Change-Id: I80fb04b1a224db48b53865e871f39b6364a785b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 898348
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1802095
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696156}
2019-09-12 20:43:55 +00:00
Brian Sheedy
1102f12d8e Make test_env.py compatible w/ Python 3
Makes test_env.py compatible with both Python 2 and 3. Also adds a very
simple test to ensure that it remains compatible until some other test
switches to Python 3.

As a side effect of adding the test, also makes
testing/scripts/common.py compatible with Python 3 since it's
necessary for running isolated scripts.

Bug: 898348
Change-Id: Ib58cf4c4f85df60a432764d7f744bc3fee09ae3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796525
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695825}
2019-09-11 23:07:16 +00:00
Caleb Rouleau
6844df15de [testing] Fix signal handling on Windows.
See https://bugs.chromium.org/p/chromium/issues/detail?id=733612#c6
for details.

Also add tests both for windows and non-windows.

Bug: 733612
Change-Id: Id656635a5fc79ea8f805658873599b526e764406
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796572
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695429}
2019-09-11 01:11:59 +00:00
Haiyang Pan
94c26596e5 Add a whitespace change to force the test to no longer dedupe
This is to fix the issue mentioned in crbug.com/993363

NOTRY=true
TBR=jbudorick

Bug: 993363
Change-Id: I58f3cd8ebc0761124d51be5328852a493b487eea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1751906
Commit-Queue: Haiyang Pan <hypan@google.com>
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Auto-Submit: Haiyang Pan <hypan@google.com>
Cr-Commit-Position: refs/heads/master@{#686476}
2019-08-13 17:48:11 +00:00
Caleb Rouleau
84e3e814b7 [Speed Infra] Do not output benchmark logs directly into task output
Instead, ask readers to use the isolated output directory to find the
exact logs that they are looking for. This will clean up the swarming
task output to simply become a summary explaining which benchmark runs
were kicked off.


Bug: 947103
Change-Id: I199530972acd5f1402396ddda10ac82cf61fc229
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1629432
Reviewed-by: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664957}
2019-05-30 23:34:50 +00:00
Ilia Samsonov
a0083530d7 [Test Automation] Use xvfb directly instead of xvfb-run
Thereby fix signal handling for SIGTERM and SIGINT.

The steps needed to start Xvfb are drawn from:
https://github.com/cgoldberg/xvfbwrapper/blob/master/xvfbwrapper.py
https://github.com/revnode/xvfb-run/blob/master/xvfb-run

Added unit tests to presubmit to test xvfb.py


Bug: 932240
Change-Id: I3b9439991697ae94e98b93e4f1fcfd411a451536
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548424
Commit-Queue: Ilia Samsonov <isamsonov@google.com>
Reviewed-by: Caleb Rouleau <crouleau@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652562}
2019-04-19 17:37:59 +00:00
Dirk Pranke
2cf1a15537 Modify test_env.py to print out GTEST_ env vars.
When we run a gtest-based test under swarming, if we only want to
run one shard of a test (as opposed to all of the tests), we set
GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS as environment variables.

Prior to this CL, we wouldn't actually log the values of those,
meaning that if you were only looking at the output of the test,
you wouldn't know that they were set at all, let alone what they
were set to. And that made it hard to reproduce the test run.

This CL changes test_env.py to print out the two variables if they
are set, to address that.

Change-Id: Ic1009152b8f0cb7867379a2badfcf471718a60d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549898
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647093}
2019-04-03 01:34:38 +00:00
Yves Gerey
2e22152195 [Sanitizer] Print stack trace when program aborts.
We too often miss the context when an assertion fails,
especially if it is buried in helper function.
This CL instructs clang sanitizers to dump a stack track when abort occurs.

Ref: https://github.com/google/sanitizers/wiki/SanitizerCommonFlags

Bug: webrtc:9849
Change-Id: I5bdf47279275f9bb67ba4abbe9d67a70d6e4b90b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1518579
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#640253}
2019-03-13 08:46:19 +00:00
Caleb Rouleau
fd511299fe Use the sigterm dance for testing/scripts.
https://chromium.googlesource.com/infra/luci/luci-py/+/master/appengine/swarming/doc/Bot.md#graceful-termination_aka-the-sigterm-and-sigkill-dance

test_env.py already has support for this, but it looks like a lot
of the scripts aren't using it. One reason for that could be that
there wasn't a run_command function there yet. I added a simple
run_command function, and made a bunch of scripts use it.

This should fix up all the test suites that use common.py's
functions to run subprocesses including:
 - run_telemetry_as_googletest.py
 - run_chromedriver_test.py
 - telemetry_gpu_unittests.py
 - telemetry_perf_unittests.py
 - telemetry_unittests.py
And many more!

Also delete common's run_integration_test function since no
one is using it.

Bug: 921662, 910584
Change-Id: If670e1b5725e3a7dcfda471b7141d47c73c5ef82
Reviewed-on: https://chromium-review.googlesource.com/c/1461512
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Auto-Submit: Caleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634740}
2019-02-22 18:22:00 +00:00
Ned Nguyen
7f43ff6f4c [testing/test_env.py] Update run_command_with_output to use rb and wb for processing log
This is based on Dirk's comment in https://chromium-review.googlesource.com/c/chromium/src/+/1259475#message-01cdaf3daae02840bb55b523a0eb71c9201adade

TBR=dpranke@chromium.org, jbudorick@chromium.org

Bug: 891747
Change-Id: Iec031e348d26d77de3f897641f4a151d0b4f544d
Reviewed-on: https://chromium-review.googlesource.com/c/1260519
Reviewed-by: Ned Nguyen <nednguyen@google.com>
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#596509}
2018-10-04 04:58:46 +00:00
Ned Nguyen
48142096a6 [testing/test_env.py] Use utf-8 encoding for reading test log
Bug: 891747
Change-Id: I73142c8bb5c4bbc78da71f230188e33d548a3dab
Reviewed-on: https://chromium-review.googlesource.com/c/1259475
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Caleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596397}
2018-10-03 22:17:19 +00:00
Andrew Grieve
95a2d330a7 Fix crash in timeout signal handler within testing/test_env.py
Noticed this from:
https://chromium-swarm.appspot.com/task?id=3e5bfa5ea894bf10&refresh=10&show_raw=1&wide_logs=true

Post stating it's win32 only:
https://github.com/python/mypy/issues/3872

Bug: 733612
Change-Id: I7bd8fc20e4793a225e093450ba902ae525af8ac9
Reviewed-on: https://chromium-review.googlesource.com/1117858
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570999}
2018-06-28 02:22:59 +00:00
Ben Pastene
e5ece81fab Make test_env.py forward swarming's timeout signals.
This will let any test invoked via test_env.py on swarming handle timeouts.

This should also cover xvfb.py:
https://chromium.googlesource.com/chromium/src/+/master/testing/xvfb.py#97

Bug: 733612, 848402
Change-Id: I33242bd6fe86072f0b32150eab6b878436252388
Reviewed-on: https://chromium-review.googlesource.com/1105022
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569055}
2018-06-20 22:39:34 +00:00
Charlie Andrews
5908c5d226 Revert "[test_env.py] Reland: Warm up vpython virtualenv cache on swarming task shards"
This reverts commit 2181305023.

Reason for revert: Broke (at least) webrtc's deps roller and Mac bisectors

Original change's description:
> [test_env.py] Reland: Warm up vpython virtualenv cache on swarming task shards
> 
> This will prevent tests sensitive to cold vpython startup time from
> timing out.
> 
> Relands https://chromium-review.googlesource.com/c/chromium/src/+/917802 . We
> expect this to work because test shards now include a hermetic copy of
> cpython as well as vpython (which was the failure observed in
> crbug.com/812693).
> 
> R=​dpranke@chromium.org, kbr@chromium.org, tandrii@chromium.org
> 
> Bug: 804174,812693
> Change-Id: Ic38845f8af366d9af211bef64df135176ab9ee1d
> Reviewed-on: https://chromium-review.googlesource.com/933107
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#538652}

TBR=iannucci@chromium.org,dpranke@chromium.org,kbr@chromium.org,tandrii@chromium.org

Change-Id: Ia8f6a122db20332c67b2376a176b18c68ae9efd1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 804174, 812693
Reviewed-on: https://chromium-review.googlesource.com/935028
Reviewed-by: Charlie Andrews <charliea@chromium.org>
Commit-Queue: Charlie Andrews <charliea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538843}
2018-02-23 19:00:58 +00:00
Robert Iannucci
2181305023 [test_env.py] Reland: Warm up vpython virtualenv cache on swarming task shards
This will prevent tests sensitive to cold vpython startup time from
timing out.

Relands https://chromium-review.googlesource.com/c/chromium/src/+/917802 . We
expect this to work because test shards now include a hermetic copy of
cpython as well as vpython (which was the failure observed in
crbug.com/812693).

R=dpranke@chromium.org, kbr@chromium.org, tandrii@chromium.org

Bug: 804174,812693
Change-Id: Ic38845f8af366d9af211bef64df135176ab9ee1d
Reviewed-on: https://chromium-review.googlesource.com/933107
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538652}
2018-02-23 01:22:18 +00:00
Kenneth Russell
7dde857919 Revert "[test_env.py] Warm up vpython virtualenv cache on swarming task shards."
This reverts commit 8348d507e2.

Reason for revert: Broke multiple Windows bots per http://crbug.com/812693 .

Original change's description:
> [test_env.py] Warm up vpython virtualenv cache on swarming task shards.
> 
> This will prevent tests sensitive to cold vpython startup time from
> timing out.
> 
> Bug: 804174
> Change-Id: Ieaf6e0d94fa668fd26481fe3efcaf6d0e968864d
> Reviewed-on: https://chromium-review.googlesource.com/917802
> Reviewed-by: Daniel Jacques <dnj@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#536766}

TBR=iannucci@chromium.org,dpranke@chromium.org,kbr@chromium.org,dnj@chromium.org,tandrii@chromium.org,bpastene@chromium.org,jbudorick@chromium.org

Change-Id: I02c3b0b1a44c24fc4f20e09431fac21053df74a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 804174, 812693
Reviewed-on: https://chromium-review.googlesource.com/922581
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537084}
2018-02-15 18:40:42 +00:00
Robert Iannucci
8348d507e2 [test_env.py] Warm up vpython virtualenv cache on swarming task shards.
This will prevent tests sensitive to cold vpython startup time from
timing out.

Bug: 804174
Change-Id: Ieaf6e0d94fa668fd26481fe3efcaf6d0e968864d
Reviewed-on: https://chromium-review.googlesource.com/917802
Reviewed-by: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536766}
2018-02-14 19:01:15 +00:00
Trent Apted
b185243c6e Add views_perftests to the CQ and Waterfall (before adding to perf bots)
views_perftests run like cc_perftests. However, they need xvfb.

cc_perftests uses run_gtest_perf_test.py. However, its xvfb support has
been broken since r434762 which removed should_start_xvfb and other things.

run_telemetry_benchmark_as_googletest.py was fixed to cater for this
change in r491092. However, the same fix does not work for
run_gtest_perf_test.py because the helper in xvfb.py does not allow
stdout to redirect to a file, which is needed for the perf chart json
output.

Update xvfb.py to support this. However, having xvfb.py depend on
scripts/common.py creates a mess, so resolve by moving the
run_command_with_output() wrapper from testing/scripts/common.py to
testing/test_env.py. Nothing else is using it.

Start wrapping these test scripts in a proper gn target in testing/BUILD.gn
to avoid the same list appearing in dozens of places. However, this exposes
testing/BUILD.gn to the `gn check` graph, which requires fixing a silent
dependency that lots of test targets have on //testing/gmock_mutant.

Bug: 785522
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I413b642d53a8a6c8f8cc5326ff47e899b36abd37
Reviewed-on: https://chromium-review.googlesource.com/848466
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531789}
2018-01-25 02:15:10 +00:00
Dirk Pranke
50e557ba77 Ensure that CHROME_HEADLESS is set for gtest-based tests on the bots.
When tests were run locally on buildbot builders, we'd set
CHROME_HEADLESS to tell tests that they weren't being run
interactively (so we wouldn't do things like show modal dialogs
that might be flaky or problematic).

Apparently we never thought to propagate this over to swarming :(.

This change sets the env var in test_env.py, which should take
effect for all desktop gtest-based tests. It's unclear if the
env var also is needed for iOS and Android, and whether we'll
need to set this elsewhere as well, but this should solve at
least some problems for now.

R=jbudorick@chromium.org, maruel@chromium.org
BUG=790985

Change-Id: I3914568c2a9e56ae5f6e450708491fecf6f57f48
Reviewed-on: https://chromium-review.googlesource.com/804398
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521127}
2017-12-01 23:48:09 +00:00
pcc
46233c2b5d Make the linux_chromium_cfi_rel_ng trybot more useful.
This change causes the trybot to:
- use ThinLTO
- produce detailed diagnostics
- produce symbolized stack traces.
The goal is to reduce cycle times on the bot, as well as provide more
details when it fails so that its results are more actionable.

Tested by patching a bad cast into one of the base_unittests and
sending a swarming job as described here:
http://dev.chromium.org/developers/testing/isolated-testing/for-swes#TOC-Run-a-test-built-locally-on-Swarming

BUG=732652
R=dpranke@chromium.org

Review-Url: https://codereview.chromium.org/2938383004
Cr-Commit-Position: refs/heads/master@{#480983}
2017-06-20 22:11:41 +00:00
maruel
f00125f82a Flush stdout before shelling out.
Otherwise the output can be intermingled.

R=dpranke@chromium.org
BUG=666867

Review-Url: https://codereview.chromium.org/2515643003
Cr-Commit-Position: refs/heads/master@{#433340}
2016-11-19 00:04:55 +00:00
thakis
45643b4ede Don't silently swallow error about symbolize script not existing.
Depends on https://codereview.chromium.org/1645183003/

BUG=582457

Review URL: https://codereview.chromium.org/1647653008

Cr-Commit-Position: refs/heads/master@{#372431}
2016-01-29 21:55:15 +00:00