xref: /aosp_15_r20/external/angle/doc/TestingOnBots.md (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker# Testing on bots
2*8975f5c5SAndroid Build Coastguard Worker
3*8975f5c5SAndroid Build Coastguard WorkerSometimes a failure happens consistently (or flakily) on bots but is difficult to reproduce locally
4*8975f5c5SAndroid Build Coastguard Workerdue to a different platform, driver version, etc. The same build can be triggered on a matching bot
5*8975f5c5SAndroid Build Coastguard Workerwith additional arguments using the following steps. Triggering swarming tasks from a local build
6*8975f5c5SAndroid Build Coastguard Workercan also sometimes be useful (see [`scripts/trigger.py`](../scripts/trigger.py)).
7*8975f5c5SAndroid Build Coastguard Worker
8*8975f5c5SAndroid Build Coastguard Worker## Navigate to the shard
9*8975f5c5SAndroid Build Coastguard Worker
10*8975f5c5SAndroid Build Coastguard Worker![Test shard failure](img/TestShardFailure.png)
11*8975f5c5SAndroid Build Coastguard Worker
12*8975f5c5SAndroid Build Coastguard Worker## Note the task dimensions as well as the "CAS inputs" identifier
13*8975f5c5SAndroid Build Coastguard Worker
14*8975f5c5SAndroid Build Coastguard Worker![Swarming task info](img/SwarmingTaskInfo.png)
15*8975f5c5SAndroid Build Coastguard Worker
16*8975f5c5SAndroid Build Coastguard Worker* Task dimensions is a filter that limits which bots in the swarming pool will pick up the task. For
17*8975f5c5SAndroid Build Coastguard Worker  example, here we can limit to the same OS and GPU with `-d os=Windows-10` and
18*8975f5c5SAndroid Build Coastguard Worker  `-d gpu=8086:9bc5-31.0.101.2127` (note: this numeric GPU id encodes both the vendor and the
19*8975f5c5SAndroid Build Coastguard Worker  specific driver version)
20*8975f5c5SAndroid Build Coastguard Worker
21*8975f5c5SAndroid Build Coastguard Worker## Find additional args required to repro
22*8975f5c5SAndroid Build Coastguard Worker
23*8975f5c5SAndroid Build Coastguard WorkerThe failure may or may not repro in isolation. Usually the test log will contain `--gtest_filter=`
24*8975f5c5SAndroid Build Coastguard Workerwith the batch that was used when the failure occurred:
25*8975f5c5SAndroid Build Coastguard Worker
26*8975f5c5SAndroid Build Coastguard Worker![Test batch failure](img/TestBatchFailure.png)
27*8975f5c5SAndroid Build Coastguard Worker
28*8975f5c5SAndroid Build Coastguard Worker* If not reproducible in isolation, it's usually easiest to start with the same batch to confirm the
29*8975f5c5SAndroid Build Coastguard Worker  failure is reproduced and then trim the list down.
30*8975f5c5SAndroid Build Coastguard Worker
31*8975f5c5SAndroid Build Coastguard Worker* Sometimes additional args are required (can be found in logs of the original task).
32*8975f5c5SAndroid Build Coastguard Worker
33*8975f5c5SAndroid Build Coastguard Worker## Triggering a swarming task
34*8975f5c5SAndroid Build Coastguard Worker
35*8975f5c5SAndroid Build Coastguard WorkerYou can trigger swarming tasks directly using `tools/luci-go/swarming trigger` from an ANGLE
36*8975f5c5SAndroid Build Coastguard Workercheckout.
37*8975f5c5SAndroid Build Coastguard Worker
38*8975f5c5SAndroid Build Coastguard WorkerACLs: ANGLE realm (e.g. `angle:try`) is guarded by
39*8975f5c5SAndroid Build Coastguard Workerhttps://chrome-infra-auth.appspot.com/auth/groups/project-angle-owners. If that shows
40*8975f5c5SAndroid Build Coastguard Worker`PermissionDenied`, you could also try `chromium:try`.
41*8975f5c5SAndroid Build Coastguard Worker
42*8975f5c5SAndroid Build Coastguard WorkerFor example, trigger that reproduced the failure in the example above - filter had to include the
43*8975f5c5SAndroid Build Coastguard Workerfailing test and the test that ran right before it:
44*8975f5c5SAndroid Build Coastguard Worker
45*8975f5c5SAndroid Build Coastguard Worker```
46*8975f5c5SAndroid Build Coastguard Worker% tools/luci-go/swarming trigger \
47*8975f5c5SAndroid Build Coastguard Worker  -digest=e11fb5a14596dce84e86a4776d65c5da26acda8e5b04257988cf2fa8ac4c5630/399 \
48*8975f5c5SAndroid Build Coastguard Worker  -realm angle:try \
49*8975f5c5SAndroid Build Coastguard Worker  -priority=20 \
50*8975f5c5SAndroid Build Coastguard Worker  -server=https://chromium-swarm.appspot.com \
51*8975f5c5SAndroid Build Coastguard Worker  -d os=Windows-10 \
52*8975f5c5SAndroid Build Coastguard Worker  -d pool=chromium.tests.gpu \
53*8975f5c5SAndroid Build Coastguard Worker  -d cpu=x86-64 \
54*8975f5c5SAndroid Build Coastguard Worker  -d gpu=8086:9bc5-31.0.101.2127 \
55*8975f5c5SAndroid Build Coastguard Worker  -service-account=chromium-tester@chops-service-accounts.iam.gserviceaccount.com \
56*8975f5c5SAndroid Build Coastguard Worker  -env=ISOLATED_OUTDIR=\${ISOLATED_OUTDIR} \
57*8975f5c5SAndroid Build Coastguard Worker  -relative-cwd=out/Release_x64 \
58*8975f5c5SAndroid Build Coastguard Worker  -- vpython3 ../../testing/test_env.py \
59*8975f5c5SAndroid Build Coastguard Worker  ./angle_end2end_tests.exe \
60*8975f5c5SAndroid Build Coastguard Worker  --isolated-script-test-output=\${ISOLATED_OUTDIR}/output.json \
61*8975f5c5SAndroid Build Coastguard Worker  --gtest_filter=EGLDisplayTest.InitializeMultipleTimesInDifferentThreads/ES2_D3D11_NoFixture:EGLPresentPathD3D11.ClientBufferPresentPathFast/ES2_D3D11_NoFixture
62*8975f5c5SAndroid Build Coastguard Worker```
63*8975f5c5SAndroid Build Coastguard Worker
64*8975f5c5SAndroid Build Coastguard WorkerAdditional notes:
65*8975f5c5SAndroid Build Coastguard Worker
66*8975f5c5SAndroid Build Coastguard Worker* It occasionally matters that bots run with `--test-launcher-bot-mode` - this sets `mBotMode=true`
67*8975f5c5SAndroid Build Coastguard Worker  in ANGLE harness and enables running multiple windows in parallel (however, on some bots
68*8975f5c5SAndroid Build Coastguard Worker  multi-processing is deactivated due to flakes, in which case you can find `--max-processes` arg
69*8975f5c5SAndroid Build Coastguard Worker  in the logs). Naturally, multiple windows are not supported on Android bots. If the failure
70*8975f5c5SAndroid Build Coastguard Worker  you're investigating is on a platform which runs with multi-processing, you might want to try
71*8975f5c5SAndroid Build Coastguard Worker  experimenting with these flags.
72*8975f5c5SAndroid Build Coastguard Worker
73*8975f5c5SAndroid Build Coastguard Worker* See [`scripts/trigger.py`](../scripts/trigger.py) for triggering tasks from local builds - it
74*8975f5c5SAndroid Build Coastguard Worker  first produces a CAS digest and then triggers a task using swarming trigger similar to the
75*8975f5c5SAndroid Build Coastguard Worker  command above.
76*8975f5c5SAndroid Build Coastguard Worker
77*8975f5c5SAndroid Build Coastguard Worker* CAS digests from bot builds can also be useful, e.g. by uploading a change and triggering a
78*8975f5c5SAndroid Build Coastguard Worker  builder to get a build on a platform you may not have access to, or by taking a digest of a
79*8975f5c5SAndroid Build Coastguard Worker  previous CI failure.
80*8975f5c5SAndroid Build Coastguard Worker
81*8975f5c5SAndroid Build Coastguard Worker* `-relative-cwd` and binary can be figured out by clicking on "CAS inputs" and inspecting `out`;
82*8975f5c5SAndroid Build Coastguard Worker  this can also be found in task logs.
83