Skip to content

Commit cc9fd72

Browse files
authored
test(android-e2e): read the logcat tail for rotation evidence (#2359)
The first CI failure with the evidence hook (PR #2356, run 34029660070) lost its logcat section: dumping the emulator's whole 2MB buffer took longer than the 5s per-probe bound on the loaded host. The probe now reads the last 4000 lines, which holds the rotation decisions of the last minutes and returns well inside the bound.
1 parent 64b7cc4 commit cc9fd72

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/integration/android-emulator-e2e/live-harness.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export function createContext(): LiveContext {
4242
const execFileAsync = promisify(execFile);
4343

4444
const ROTATION_PROBE_TIMEOUT_MS = 5_000;
45+
/** Lines read back from logcat; the rotation decisions of the last few minutes fit comfortably. */
46+
const ROTATION_LOG_TAIL = 4_000;
4547
const ROTATION_LOG_LINES = 60;
4648
const ROTATION_LOG_LINE_LENGTH = 240;
4749

@@ -56,7 +58,9 @@ async function readAndroidRotationEvidence(context: LiveContext): Promise<string
5658
['accelerometer_rotation', ['shell', 'settings', 'get', 'system', 'accelerometer_rotation']],
5759
['user_rotation', ['shell', 'settings', 'get', 'system', 'user_rotation']],
5860
['display rotation', ['shell', 'dumpsys', 'display']],
59-
['logcat rotation decisions', ['logcat', '-d', '-v', 'time']],
61+
// The tail, not the whole buffer: the emulator keeps 2MB and a loaded one takes seconds to
62+
// dump it, which is what the group bound is for, not this read.
63+
['logcat rotation decisions', ['logcat', '-d', '-v', 'time', '-t', String(ROTATION_LOG_TAIL)]],
6064
];
6165
const sections: string[] = [];
6266
for (const [title, args] of probes) {

0 commit comments

Comments
 (0)