Add a Log.wtf() on user builds to test Pitot reporting pipeline
Apparently, we have previously seen instances of the pipeline being
broken, so this is adding a Log.wtf() to test the pipeline.
It is only run on user builds to not randomly crash droidfood devices.
Test: cf boots
Change-Id: Ie4e6661adef6f1878529688561805f2485e58391
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java
index ba059ab..f366f84 100755
--- a/service/src/com/android/server/ConnectivityService.java
+++ b/service/src/com/android/server/ConnectivityService.java
@@ -385,6 +385,7 @@
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Objects;
+import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.StringJoiner;
@@ -1839,6 +1840,11 @@
// Temporary hack to report netbpfload result.
// TODO: remove in 2024-09 when netbpfload starts loading mainline bpf programs.
mHandler.postDelayed(() -> {
+ // Test Pitot pipeline, ignore this Log.wtf if it shows up in the logs.
+ final Random r = new Random();
+ if (Build.TYPE.equals("user") && r.nextInt(1000) == 0) {
+ Log.wtf(TAG, "NOT A FAILURE, PLEASE IGNORE! Test Pitot pipeline works correctly");
+ }
// Did netbpfload create the map?
try {
Os.access("/sys/fs/bpf/net_shared/map_gentle_test", F_OK);