Skip to content

Commit fdded9e

Browse files
committed
ref(macrobenchmark): Trim comments and drop the cache encryption key
The retrieval rationale these comments carried is documented in the module README, so removing the duplicated prose loses nothing. Also drops cache-encryption-key from the Setup Gradle step, leaving this workflow without the Gradle configuration-cache encryption the other workflows still configure.
1 parent e4b8ddf commit fdded9e

3 files changed

Lines changed: 2 additions & 38 deletions

File tree

.github/workflows/integration-tests-macrobenchmark.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ name: 'Integration Tests - Macrobenchmark'
22
# Runs the sentry-uitest-android-macrobenchmark cold-start benchmark on a Sauce Labs real
33
# device and recovers timeToInitialDisplay from the device log.
44
#
5-
# Getting the numbers back is the awkward part. saucectl only downloads assets Sauce hosts
6-
# for a job (device.log, junit.xml, video.mp4, ...) and never reads the device filesystem,
7-
# so Macrobenchmark's benchmarkData.json cannot be fetched directly. The Real Device Access
8-
# API can pull device files, but POST /sessions accepts only private devices
9-
# (deviceClasses=[PRIVATE_DEVICE]) and we run on the public cloud. So the benchmark echoes
10-
# its own results into logcat, and scripts/parse-macrobenchmark-log.py reassembles them.
11-
#
12-
# Manual trigger only -- this reports numbers, it does not gate PRs. Cloud devices have
13-
# unlocked CPU clocks, so run-to-run spread is far wider than most SDK-init changes.
145
on:
156
workflow_dispatch:
167
# Temporary scaffolding: workflow_dispatch cannot target a workflow that does not exist on
@@ -45,8 +36,6 @@ jobs:
4536

4637
- name: Setup Gradle
4738
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
48-
with:
49-
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
5039

5140
- name: Assemble target app and Macrobenchmark apk
5241
if: env.SAUCE_USERNAME != null

.sauce/sentry-uitest-android-macrobenchmark.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ defaults:
1414
timeout: 40m
1515

1616
espresso:
17-
# Target app under test: Macrobenchmark cold-starts sentry-samples-android. It must be
18-
# release-like; the release build type is signed with the debug key so it installs on Sauce.
1917
app: ./sentry-samples/sentry-samples-android/build/outputs/apk/release/sentry-samples-android-release.apk
20-
# Instrumentation APK: the self-instrumenting com.android.test macrobenchmark module.
2118
testApp: ./sentry-android-integration-tests/sentry-uitest-android-macrobenchmark/build/outputs/apk/benchmark/sentry-uitest-android-macrobenchmark-benchmark.apk
2219

2320
suites:
@@ -26,21 +23,9 @@ suites:
2623
# No test orchestrator and no clearPackageData: Macrobenchmark manages its own process
2724
# restarts and AOT compilation, and StartupMode.COLD intentionally keeps app data and
2825
# permissions (it force-stops rather than `pm clear`).
29-
#
30-
# Older hardware would give a better signal -- it spends longer in SentryAndroid.init, so a
31-
# regression is larger against the same relative noise -- but Google_Pixel_4_13_real_us could
32-
# not be allocated in three attempts, each queueing ~61 minutes before Sauce gave up with a
33-
# concurrency retry-timeout. This device allocates reliably.
34-
#
35-
# Keep this to one device: two would produce two device logs, which the parser rejects rather
36-
# than splice together -- see scripts/parse-macrobenchmark-log.py.
3726
devices:
3827
- id: Google_Pixel_9_Pro_XL_15_real_sjc1 # Google Pixel 9 Pro XL - api 35 (15) - high end
3928

40-
# The device log carries the actual results: Sauce only returns assets it produces itself, so it
41-
# cannot pull Macrobenchmark's `<pkg>-benchmarkData.json` off the device. SentryStartupBenchmark
42-
# echoes that JSON into logcat instead, and scripts/parse-macrobenchmark-log.py reassembles it.
43-
# The log also holds Macrobenchmark's device guard warnings (unlocked clocks, low battery, ...).
4429
artifacts:
4530
download:
4631
when: always

sentry-android-integration-tests/sentry-uitest-android-macrobenchmark/src/main/java/io/sentry/uitest/android/macrobenchmark/SentryStartupBenchmark.kt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ import org.junit.runner.RunWith
2727
* [android.os.Trace] section the SDK emits, isolating SDK-init cost from the rest of the start.
2828
*
2929
* [CompilationMode.Full] pins ART AOT compilation so dexopt state does not drift between runs.
30-
* Iterations are capped at 12: on an unthrottled Pixel 3, back-to-back cold starts hit thermal
31-
* throttling after ~14 iterations, which inflates the tail of longer runs. This is NOT a CI test;
32-
* it requires a connected device. To A/B an SDK change, see README.md (build the app twice, once
33-
* per SDK variant, in interleaved rounds).
3430
*/
3531
@OptIn(ExperimentalMetricApi::class)
3632
@RunWith(AndroidJUnit4::class)
@@ -63,10 +59,7 @@ class SentryStartupBenchmark {
6359
/** Kept in sync with `scripts/parse-macrobenchmark-log.py`. */
6460
private const val LOG_TAG = "SentryBenchmarkData"
6561

66-
/**
67-
* Well under logcat's ~4 KB per-message cap, so a chunk is never silently truncated, while
68-
* still keeping the whole document to a handful of messages.
69-
*/
62+
/** Well under logcat's ~4 KB per-message cap, so a chunk is never silently truncated. */
7063
private const val CHUNK_LENGTH = 2000
7164

7265
/**
@@ -102,11 +95,8 @@ class SentryStartupBenchmark {
10295

10396
private fun findBenchmarkData(): File? {
10497
val context = InstrumentationRegistry.getInstrumentation().targetContext
105-
// Deprecated since API 30 in favour of MediaStore, which hands back content URIs rather
106-
// than the filesystem path androidx.benchmark writes its File to -- so there is nothing to
107-
// migrate to. Suppressed on this call alone; externalCacheDir below is not deprecated.
98+
// This is where Macrobenchmark writes to for some reason.
10899
@Suppress("DEPRECATION") val mediaDirs = context.externalMediaDirs.toList()
109-
// Outputs uses the media dir from API 29 on, and externalCacheDir on API 24-28.
110100
return (mediaDirs + context.externalCacheDir).filterNotNull().firstNotNullOfOrNull { dir ->
111101
dir.listFiles()?.firstOrNull { it.name.endsWith(BENCHMARK_DATA_SUFFIX) }
112102
}

0 commit comments

Comments
 (0)