This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch spring6
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git

commit e0c305f5b4aab0fa3708a66be9520236e2748030
Author: kezhenxu94 <kezhenx...@apache.org>
AuthorDate: Fri Feb 24 13:37:56 2023 +0800

    Try to fix Spring 6 test case
---
 .github/workflows/plugins-jdk17-test.1.yaml        |  3 ++
 .github/workflows/plugins-test.2.yaml              | 23 ++--------
 .github/workflows/plugins-test.3.yaml              | 53 ++--------------------
 .../sync/define/RestTemplateInstrumentation.java   |  2 +-
 .../sync/define/RestTemplateInstrumentation.java   |  7 ++-
 5 files changed, 15 insertions(+), 73 deletions(-)

diff --git a/.github/workflows/plugins-jdk17-test.1.yaml 
b/.github/workflows/plugins-jdk17-test.1.yaml
index d820466d8c..6a671c312b 100644
--- a/.github/workflows/plugins-jdk17-test.1.yaml
+++ b/.github/workflows/plugins-jdk17-test.1.yaml
@@ -17,6 +17,9 @@
 name: Test
 
 on:
+  push:
+    branches:
+      - spring6
   pull_request:
     paths:
       - '.github/workflows/plugins-*.yaml'
diff --git a/.github/workflows/plugins-test.2.yaml 
b/.github/workflows/plugins-test.2.yaml
index 1b6ecaa9f9..c58dd82782 100644
--- a/.github/workflows/plugins-test.2.yaml
+++ b/.github/workflows/plugins-test.2.yaml
@@ -17,6 +17,9 @@
 name: Test
 
 on:
+  push:
+    branches:
+      - spring6
   pull_request:
     paths:
       - '.github/workflows/plugins-*.yaml'
@@ -52,31 +55,11 @@ jobs:
     strategy:
       matrix:
         case:
-          - okhttp-scenario
-          - play-scenario
-          - postgresql-scenario
-          - pulsar-scenario
-          - rabbitmq-scenario
-          - redisson-scenario
-          - resttemplate-4.x-scenario
-          - servicecomb-1.x-scenario
-          - servicecomb-2.x-scenario
-          - shardingsphere-3.x-scenario
-          - shardingsphere-4.0.x-scenario
-          - shardingsphere-4.x-scenario
-          - shardingsphere-5.0.0-scenario
-          - sofarpc-scenario
-          - solrj-7.x-scenario
           - spring-3.0.x-scenario
           - spring-cloud-feign-1.1.x-scenario
           - spring-cloud-feign-1.2.x-scenario
           - spring-cloud-feign-2.x-scenario
           - spring-tx-scenario
-          - struts2.3-scenario
-          - struts2.5-scenario
-          - cxf-scenario
-          - okhttp2-scenario
-          - rocketmq-scenario
     steps:
       - uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/plugins-test.3.yaml 
b/.github/workflows/plugins-test.3.yaml
index 3127472d31..3d917bdd89 100644
--- a/.github/workflows/plugins-test.3.yaml
+++ b/.github/workflows/plugins-test.3.yaml
@@ -17,6 +17,9 @@
 name: Test
 
 on:
+  push:
+    branches:
+      - spring6
   pull_request:
     paths:
       - '.github/workflows/plugins-*.yaml'
@@ -52,60 +55,10 @@ jobs:
     strategy:
       matrix:
         case:
-          - mysql-scenario
-          - undertow-scenario
-          - webflux-scenario
-          - zookeeper-scenario
           - spring-3.1.x-scenario
           - spring-4.1.x-scenario
           - spring-4.3.x-scenario
           - spring-async-scenario
-          - vertx-core-4.x-scenario
-          - vertx-eventbus-3.x-scenario
-          - vertx-web-3.54minus-scenario
-          - vertx-web-3.6plus-scenario
-          - mariadb-scenario
-          - micronaut-http-scenario
-          - nats-2.14.x-2.15.x-scenario
-          - quasar-scenario
-          - baidu-brpc-scenario
-          - baidu-brpc-3.x-scenario
-          - retransform-class-scenario
-          - retransform-class-tomcat-scenario
-          - graphql-8.x-scenario
-          - graphql-9.x-scenario
-          - graphql-16plus-scenario
-          - graphql-12.x-15.x-scenario
-          - hbase-scenario
-          - spring-kafka-1.3.x-scenario
-          - spring-kafka-2.2.x-scenario
-          - spring-kafka-2.3.x-scenario
-          - spring-scheduled-scenario
-          - elasticjob-2.x-scenario
-          - quartz-scheduler-2.x-scenario
-          - xxl-job-2.2.0-scenario
-          - xxl-job-2.3.x-scenario
-          - thrift-scenario
-          - dbcp-2.x-scenario
-          - jsonrpc4j-1.x-scenario
-          - gateway-3.x-scenario
-          - neo4j-4.x-scenario
-          - oracle-scenario
-          - druid-1.x-scenario
-          - hikaricp-scenario
-          - clickhouse-0.3.1-scenario
-          - clickhouse-0.3.2.x-scenario
-          - kylin-jdbc-2.6.x-3.x-4.x-scenario
-          - undertow-worker-thread-pool-scenario
-          - tomcat-thread-pool-scenario
-          - guava-eventbus-scenario
-          - shenyu-2.4.x-scenario
-          - jdk-threadpool-scenario
-          - shenyu-2.4.x-dubbo-scenario
-          - grpc-generic-call-scenario
-          - shenyu-2.4.x-grpc-scenario
-          - shenyu-2.4.x-sofarpc-scenario
-          - impala-jdbc-2.6.x-scenario
     steps:
       - uses: actions/checkout@v2
         with:
diff --git 
a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/define/RestTemplateInstrumentation.java
 
b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/define/RestTemplateInstrumentation.java
index 9c98b81c50..cb05f144f0 100644
--- 
a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/define/RestTemplateInstrumentation.java
+++ 
b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/define/RestTemplateInstrumentation.java
@@ -115,7 +115,7 @@ public class RestTemplateInstrumentation extends 
ClassInstanceMethodsEnhancePlug
     @Override
     protected String[] witnessClasses() {
         return new String[] {
-            
"org.springframework.web.context.support.ServletContextAttributeFactoryBean"
+            "org.springframework.web.client.AsyncRequestCallback"
         };
     }
 }
diff --git 
a/apm-sniffer/optional-plugins/optional-spring-plugins/resttemplate-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/v6x/sync/define/RestTemplateInstrumentation.java
 
b/apm-sniffer/optional-plugins/optional-spring-plugins/resttemplate-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/v6x/sync/define/RestTemplateInstrumentation.java
index c9fdb3823d..2c22415b4e 100644
--- 
a/apm-sniffer/optional-plugins/optional-spring-plugins/resttemplate-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/v6x/sync/define/RestTemplateInstrumentation.java
+++ 
b/apm-sniffer/optional-plugins/optional-spring-plugins/resttemplate-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/v6x/sync/define/RestTemplateInstrumentation.java
@@ -26,6 +26,7 @@ import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
 import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
 
 import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
 import static 
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
 
 /**
@@ -59,7 +60,9 @@ public class RestTemplateInstrumentation extends 
ClassInstanceMethodsEnhancePlug
             new InstanceMethodsInterceptPoint() {
                 @Override
                 public ElementMatcher<MethodDescription> getMethodsMatcher() {
-                    return named(DO_EXECUTE_METHOD_NAME);
+                    return named(DO_EXECUTE_METHOD_NAME)
+                            .and(takesArgument(0, named("java.net.URI")))
+                            .and(takesArgument(2, 
named("org.springframework.http.HttpMethod")));
                 }
 
                 @Override
@@ -115,7 +118,7 @@ public class RestTemplateInstrumentation extends 
ClassInstanceMethodsEnhancePlug
     @Override
     protected String[] witnessClasses() {
         return new String[] {
-            "org.springframework.web.client.ClientHttpResponseDecorator"
+            "org.springframework.http.client.reactive.JdkClientHttpConnector"
         };
     }
 }

Reply via email to