Re-enable test 566-polymorphic-inlining.

- Can not rely on debug builds.
- Need to wait for the method to be compiled.

Change-Id: I26ce89075075da8555fd59ade56bd04bec23f4ce
diff --git a/test/566-polymorphic-inlining/polymorphic_inline.cc b/test/566-polymorphic-inlining/polymorphic_inline.cc
index 55eac5c..b2934ed 100644
--- a/test/566-polymorphic-inlining/polymorphic_inline.cc
+++ b/test/566-polymorphic-inlining/polymorphic_inline.cc
@@ -29,11 +29,18 @@
   jit::Jit* jit = Runtime::Current()->GetJit();
   jit::JitCodeCache* code_cache = jit->GetCodeCache();
   ArtMethod* method = klass->FindDeclaredDirectMethodByName(method_name, sizeof(void*));
-  jit->CompileMethod(method, soa.Self());
 
-  OatQuickMethodHeader* header = OatQuickMethodHeader::FromEntryPoint(
-      method->GetEntryPointFromQuickCompiledCode());
-  CHECK(code_cache->ContainsPc(header->GetCode()));
+  OatQuickMethodHeader* header = nullptr;
+  // Infinite loop... Test harness will have its own timeout.
+  while (true) {
+    header = OatQuickMethodHeader::FromEntryPoint(method->GetEntryPointFromQuickCompiledCode());
+    if (code_cache->ContainsPc(header->GetCode())) {
+      break;
+    } else {
+      // sleep one second to give time to the JIT compiler.
+      sleep(1);
+    }
+  }
 
   CodeInfo info = header->GetOptimizedCodeInfo();
   CHECK(info.HasInlineInfo());
@@ -45,6 +52,11 @@
     return;
   }
 
+  if (kIsDebugBuild) {
+    // A debug build might often compile the methods without profiling informations filled.
+    return;
+  }
+
   do_checks(cls, "testInvokeVirtual");
   do_checks(cls, "testInvokeInterface");
 }