Relax fd leak check

Fixes: 111308777
Bug: 128652499
Test: this
Merged-In: Ic2632a12beac5d7d32820c4cb55c863460ad95a5
Change-Id: Ic2632a12beac5d7d32820c4cb55c863460ad95a5
diff --git a/tests/tests/graphics/src/android/graphics/cts/BitmapTest.java b/tests/tests/graphics/src/android/graphics/cts/BitmapTest.java
index 9bb13c5..d1a8526 100644
--- a/tests/tests/graphics/src/android/graphics/cts/BitmapTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/BitmapTest.java
@@ -1523,7 +1523,11 @@
         for (int i = 0; i < 2000; i++) {
             if (i % 100 == 5) {
                 assertNotLeaking(i, meminfoStart, meminfoEnd);
-                assertEquals(fdCount, getFdCount());
+                final int curFdCount = getFdCount();
+                if (curFdCount - fdCount > 5) {
+                    fail(String.format("FDs leaked. Expected=%d, current=%d, iteration=%d",
+                            fdCount, curFdCount, i));
+                }
             }
             test.run();
         }