Repository navigation
fix(simple-java-dedup): run on embedded Tomcat for java-sdk v3 dynamic dedup - #158
Open
slayerjain wants to merge 1 commit into
Open
slayerjain wants to merge 1 commit into
slayerjain wants to merge 1 commit into
Conversation
…c dedup com.sun.net.httpserver.HttpServer is not counted by keploy-sdk's request-window tracker, so Kubernetes dynamic dedup (k8s-proxy >= v3.8.30) fails closed with unverified:no-server-entry and drops 0 duplicates. - Switch simple-java-dedup to embedded Tomcat 9 (tomcat-embed-core 9.0.121, Java 8+ compatible), preserving all 5 exact endpoints (/healthz, /grade, /shipping, /inventory, /invoice), branch structure, and JSON responses. - Copy runtime dependencies into target/lib with manifest Class-Path so both native `java -jar target/simple-java-dedup.jar` and the Dockerfile work without baking agents into lib/. - Document supported Java HTTP servers (Tomcat 8.5-11, Jetty 9.4-12, Undertow) and why embedded Tomcat is used in simple-java-dedup/README.md. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switches
simple-java-dedupfromcom.sun.net.httpserver.HttpServerto embedded Tomcat 9 (org.apache.tomcat.embed:tomcat-embed-core:9.0.121, Java 8+ compatible) so it works out of the box with both Kubernetes (k8s-proxy >= v3.8.30) and CLI dynamic deduplication.Why
keploy-sdk >= 2.3.xcounts HTTP request windows at supported server entry points (Tomcat 8.5–11, Jetty 9.4–12, Undertow) so background threads and post-response work cannot leak coverage between test cases.com.sun.net.httpserver.HttpServeris not counted, so Kubernetes dynamic dedup fails closed (unverified:no-server-entry) and keeps all test cases with 0 duplicates.Changes
simple-java-dedup/pom.xml: addtomcat-embed-core:9.0.121, copy runtime dependencies intotarget/lib, and emit manifestClass-Path: lib/...(agents remain outsidetarget/lib).simple-java-dedup/src/main/java/.../SimpleJavaDedupApplication.java: serve the same 5 exact paths (/healthz,/grade,/shipping,/inventory,/invoice) with the same branch structure and JSON responses on embedded Tomcat.simple-java-dedup/Dockerfile&.dockerignore: includetarget/libalongside/app/app.jar(still running as non-rootuid 10001).simple-java-dedup/README.md: explain why embedded Tomcat is used and list the supported Java HTTP servers (Tomcat 8.5–11, Jetty 9.4–12, Undertow).Verification
Box-verified on both Java 8 (
eclipse-temurin:8-jre) and Java 17 (eclipse-temurin:17-jre) as non-rootuid 10001withjava-sdk 2.3.1(keploy-dedup-jars:3.8.30):keploy/test-set-0/tests/test-*.yamlrequests returned exact matching status code,Content-Type: application/json, and JSON body.HELLOreportedwindowCut=true,asyncExecutors=true, 0unverifiedframes.(test-3, test-2),(test-7, test-6),(test-10, test-9),(test-13, test-12).