Merge "Speed up and reenable test for b/141603906" am: 58578023dc
am: 24589540b2
Change-Id: I715948b5e483cd16ad617814d85b08778aea1bcb
This commit is contained in:
@@ -46,7 +46,6 @@ import androidx.test.runner.AndroidJUnit4;
|
|||||||
import libcore.util.HexEncoding;
|
import libcore.util.HexEncoding;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@@ -202,15 +201,30 @@ public class InetDiagSocketTest {
|
|||||||
checkGetConnectionOwnerUid("::1", "::1");
|
checkGetConnectionOwnerUid("::1", "::1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Times out on Marlin/Sailfish")
|
|
||||||
/* Verify fix for b/141603906 */
|
/* Verify fix for b/141603906 */
|
||||||
@Test
|
@Test
|
||||||
public void testB141603906() throws Exception {
|
public void testB141603906() throws Exception {
|
||||||
final InetSocketAddress src = new InetSocketAddress(0);
|
final InetSocketAddress src = new InetSocketAddress(0);
|
||||||
final InetSocketAddress dst = new InetSocketAddress(0);
|
final InetSocketAddress dst = new InetSocketAddress(0);
|
||||||
for (int i = 1; i <= 100000; i++) {
|
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);
|
mCm.getConnectionOwnerUid(IPPROTO_TCP, src, dst);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Thread thread : threads) {
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Thread thread : threads) {
|
||||||
|
thread.join();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hexadecimal representation of InetDiagReqV2 request.
|
// Hexadecimal representation of InetDiagReqV2 request.
|
||||||
|
|||||||
Reference in New Issue
Block a user