Skip to content

Commit

Permalink
Merge "Speed up and reenable test for b/141603906"
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Nov 13, 2019
2 parents ba07364 + 236e0f3 commit 5857802
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tests/net/java/android/net/netlink/InetDiagSocketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import libcore.util.HexEncoding;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -202,14 +201,29 @@ public void testGetConnectionOwnerUid() throws Exception {
checkGetConnectionOwnerUid("::1", "::1");
}

@Ignore("Times out on Marlin/Sailfish")
/* Verify fix for b/141603906 */
@Test
public void testB141603906() throws Exception {
final InetSocketAddress src = new InetSocketAddress(0);
final InetSocketAddress dst = new InetSocketAddress(0);
for (int i = 1; i <= 100000; i++) {
mCm.getConnectionOwnerUid(IPPROTO_TCP, src, dst);
final int numThreads = 8;
final int numSockets = 5000;
final Thread[] threads = new Thread[numThreads];

for (int i = 0; i < numThreads; i++) {
threads[i] = new Thread(() -> {
for (int j = 0; j < numSockets; j++) {
mCm.getConnectionOwnerUid(IPPROTO_TCP, src, dst);
}
});
}

for (Thread thread : threads) {
thread.start();
}

for (Thread thread : threads) {
thread.join();
}
}

Expand Down

0 comments on commit 5857802

Please sign in to comment.