Skip to content

Native (non-Docker) test mode with Windows support#6

Merged
marekkopecky merged 6 commits into
modcluster:mainfrom
honza-kasik:native
May 29, 2026
Merged

Native (non-Docker) test mode with Windows support#6
marekkopecky merged 6 commits into
modcluster:mainfrom
honza-kasik:native

Conversation

@honza-kasik

@honza-kasik honza-kasik commented Mar 26, 2026

Copy link
Copy Markdown
Contributor
  • Add support for running the mod_cluster test suite without Docker, using local WildFly and httpd processes (-Pnative)
  • Refactor container abstractions (WildFlyContainer → WildFlyWorker, BalancerContainer → Balancer) to be platform-independent, with Docker and native implementations
  • Fix numerous test issues discovered during Windows native runs (timing, path handling, process lifecycle)
  • Disable two tests blocked by upstream WildFly bugs
  • Add GitHub Actions CI with a matrix covering Linux Docker + Windows native

Architecture changes

  • WildFlyWorker (abstract) with DockerWildFlyWorker and NativeWildFlyWorker implementations
  • Balancer (abstract) with DockerUndertowBalancer, DockerHttpdBalancer, NativeUndertowBalancer, and NativeHttpdBalancer
  • CommandResult — platform-independent exec result replacing Testcontainers' Container.ExecResult
  • NativePortAllocator — manages port offsets for concurrent native workers
  • NativeProcessManager — process lifecycle with shutdown hooks and tree kill
  • NativeServerExtractor — extracts and caches WildFly distributions
  • TestMode — selects Docker vs native based on -Dtest.mode=native
  • All tests updated to use new abstractions; platform-specific logic isolated in implementations

Test fixes

  • Fix StickySessionForce to capture first response instead of polling
  • Fix exit.jsp to use System.exit instead of halt for reliable TCP teardown
  • Fix health-check-interval/broken-node-timeout units (seconds → milliseconds)
  • Fix port offset handling for multiple balancers in native mode
  • Disable HTTP keep-alive and HTTP/2 for reliable mod_cluster routing
  • Tolerate transient unknown responses in broken node verification
  • Clean up stale SSL configs on native httpd balancer start
  • Relax stop-context failure threshold from 10 to 15

Disabled tests

  • testStatefulEjbStickiness — JBEAP-33250: WildFly regression wildfly/wildfly@d3b318b sets JSESSIONID cookie path without leading /, breaking EJB-over-HTTP session stickiness
  • testNodeTimeout — JBEAP-9624 / JBEAP-26262: node-timeout not applied correctly on Undertow balancer

CI

  • GitHub Actions workflow running StickySessionTest on:
    • Ubuntu / Undertow / JDK 21 (Docker)
    • Ubuntu / Undertow / JDK 17 (Docker)
    • Windows / Undertow / JDK 21 (Native)

@honza-kasik honza-kasik marked this pull request as draft March 26, 2026 13:32
@honza-kasik honza-kasik force-pushed the native branch 7 times, most recently from 13194e5 to 200e363 Compare May 13, 2026 13:23
@honza-kasik honza-kasik changed the title Phase 1+2 of supporting native runs implemented Native (non-Docker) test mode with Windows support May 25, 2026
@honza-kasik honza-kasik marked this pull request as ready for review May 25, 2026 07:50
@honza-kasik honza-kasik requested a review from marekkopecky May 25, 2026 07:50

@jajik jajik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things caught my eye (but frankly, these huge PRs are hard to review).

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread src/test/java/org/jboss/modcluster/test/ssl/SSLConfigurator.java Outdated
Comment thread src/test/java/org/jboss/modcluster/test/ssl/SSLConfigurator.java Outdated
Comment thread src/test/java/org/jboss/modcluster/test/ssl/SSLConfigurator.java Outdated
Comment thread httpd,adoptiumjdk-17,w2k19&&large.txt Outdated
@jajik

jajik commented May 25, 2026

Copy link
Copy Markdown
Member

Some failures are caused by the old httpd url (https://dlcdn.apache.org/httpd/httpd-2.4.66.tar.gz -> https://dlcdn.apache.org/httpd/httpd-2.4.67.tar.gz).

@honza-kasik

Copy link
Copy Markdown
Contributor Author

@jajik Thanks, I just found out. I switched to archive instead of using mirror. I don't want to dig into CI everyday :)

Comment thread src/test/java/org/jboss/modcluster/test/ejb/EjbViaHttpTest.java Outdated
Comment thread src/test/java/org/jboss/modcluster/test/ejb/EjbViaHttpTest.java Outdated
Comment thread src/test/java/org/jboss/modcluster/test/session/SessionManagementTest.java Outdated
Comment thread src/test/java/org/jboss/modcluster/test/utils/NativeWildFlyWorker.java Outdated
Comment thread src/test/java/org/jboss/modcluster/test/utils/WildFlyContainer.java
@honza-kasik honza-kasik requested a review from marekkopecky May 26, 2026 11:06
@marekkopecky

Copy link
Copy Markdown
Contributor

It seems that #6 (comment) is last unresolved thread ....

@jajik jajik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me. Thank you.

@jajik

jajik commented May 26, 2026

Copy link
Copy Markdown
Member

(Of course, it would be nice to squash the commits meaningfully.)

Add NativeWildFlyWorker, NativeHttpdBalancer, NativeUndertowBalancer, NativePortAllocator, NativeProcessManager, and NativeServerExtractor for running tests against locally installed servers instead of Docker containers. Introduce TestMode and factory methods on Balancer.create()/WildFlyWorker.create() to dispatch on -Dtest.mode=native.

Includes config caching for faster startup, process tree management, httpd binary and config discovery on Windows/Linux, idempotent balancer configuration, standalone.xml backup/restore, and updated architecture documentation.
Disable HTTP keep-alive and HTTP/2 in Undertow mod_cluster filter for reliable routing. Fix health-check-interval and broken-node-timeout units to milliseconds and reduce to 1s/3s. Use System.exit instead of halt in exit.jsp for clean TCP teardown.

Also: fix port offset handling for multiple native balancers, fix StickySessionForce test capture, relax stop-context threshold to 15, use stricter request count on Linux with relaxed threshold on Windows, tag CPU load test as docker-only, disable testNodeTimeout (JBEAP-9624), and remove redundant post-failover verification request.
Prevent EJB client from bypassing the balancer via topology discovery by disabling it in EjbClientAppBuilder. Bind native workers to 127.0.0.1 instead of 0.0.0.0. Add TRACE logging for org.wildfly.httpclient, org.jboss.ejb.client, and org.jboss.remoting.

Disable testStatefulEjbStickiness due to WildFly bug WFLY-21930 (malformed routing cookie path).
Add StickySessionTest across OS/JDK combinations (Ubuntu JDK 17+21 Docker, Windows JDK 21 native). Use single-line shell commands for Windows compatibility, extract shared CI variables, and rework matrix as cross-product of os/java/balancer with excludes.

Also switch httpd source download to archive.apache.org for permanent URL retention.
Clean up stale SSL configs on native httpd balancer start to prevent duplicate Listen directives. Replace sed-based VirtualHost patching with a shipped mod_proxy_cluster_ssl.conf config file. Use Path.of for platform-safe SSL subpath joins.

Add SslFailoverTest to CI matrix.
Extract shared isWindows() to TestMode, removing 5 private copies. Extract WFLYSRV0025 startup pattern constant to WildFlyWorker base class. Add missing Javadoc to Balancer, WildFlyWorker, CommandResult, and ContainerUtils. Update bug reference from JBEAP-33250 to WFLY-21930.
@marekkopecky marekkopecky merged commit d8ccc3a into modcluster:main May 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants