Skip to content

Conversation

@affonsov
Copy link
Collaborator

@affonsov affonsov commented Jan 2, 2026

Summary

This PR enables Java integration tests to run on Windows using WSL (Windows Subsystem for Linux), removing the previous Windows exclusion from CI workflows. It adds WSL support for cluster management, test execution, and process cleanup.

Due to the limited resources available on GitHub Windows runners and the additional overhead of running through WSL, several optimizations were implemented:

  • Reduced Replica Count: Windows CI uses 0 replicas instead of the standard 1-4 replicas to minimize resource usage and avoid replica synchronization issues that can occur in resource-constrained environments
  • Increased Timeouts: Test timeouts were increased across multiple test classes:
    • Test class timeouts: 10s → 15s/20s to account for WSL overhead
  • WSL Overhead Considerations: The virtualization layer adds latency and resource overhead, requiring these adjustments for reliable test execution

Changes Made

CI/CD Workflow Updates

  • .github/workflows/install-shared-dependencies/action.yml: Added WSL setup with Ubuntu 22.04 and direct Valkey installation in WSL for Windows runners
  • .github/workflows/install-engine/action.yml: Added x86_64-pc-windows-msvc target support
  • .github/workflows/java-cd.yml: Removed Windows exclusion from integration tests (previously skipped with -x :integTest:test)
  • .github/workflows/java.yml: Enabled integration tests on Windows and excluded only Redis 6.2 on Windows

Java Integration Test Infrastructure

  • java/integTest/build.gradle:

    • Added getClusterCommand() helper to wrap commands with wsl prefix on Windows
    • Updated all cluster management tasks to use WSL on Windows
    • Added comprehensive cleanup in gradle.buildFinished to kill orphaned Valkey/Redis processes
    • Configured Windows to use 0 replicas (avoiding replica sync issues in CI)
    • All Python cluster_manager.py invocations now route through WSL on Windows
  • java/integTest/src/test/java/glide/cluster/ValkeyCluster.java:

    • Added getScriptPath() method to convert Windows paths to WSL format (C:\path/mnt/c/path)
    • Updated cluster start/stop commands to use wsl prefix on Windows

Test Adjustments for Windows

  • java/integTest/src/test/java/glide/TestUtilities.java: Added validation for empty host strings and improved error messages for invalid host formats
  • java/integTest/src/test/java/glide/ConnectionTests.java: Adjusted AZ affinity test to expect 0 replicas on Windows WSL CI
  • java/integTest/src/test/java/glide/SharedCommandTests.java: Updated waitTest and wait_timeout_check to handle 0 replicas on Windows WSL CI
  • java/integTest/src/test/java/glide/ErrorHandlingTests.java: Increased timeout from 10s to 15s
  • java/integTest/src/test/java/glide/standalone/BatchTests.java: Increased timeout from 10s to 20s

Issue link

This Pull Request is linked to issue (URL): [REPLACE ME]

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Due to the limited resources available on GitHub Windows runners and the additional overhead of running through WSL, several optimizations were implemented:

Reduced Replica Count: Windows CI uses 0 replicas instead of the standard 1-4 replicas to minimize resource usage and avoid replica synchronization issues that can occur in resource-constrained environments
Increased Timeouts: Test timeouts were increased across multiple test classes:
Request timeouts: 10s → 20s for better stability under WSL
Test class timeouts: 10s → 15s/20s to account for WSL overhead
Reduced Data Sizes: Large data tests reduced from 1 << 16 (64KB) to 1 << 15 (32KB) to prevent memory pressure on Windows runners
WSL Overhead Considerations: The virtualization layer adds latency and resource overhead, requiring these adjustments for reliable test execution

Signed-off-by: affonsov <[email protected]>
- Add platform check to skip test_az_affinity_replicas_and_primary_prioritizes_replicas_over_primary on Windows
- Windows integration tests have replicas set to zero due to GitHub Actions WSL resource constraints
- Server initialization hangs with replica configuration on Windows runner
- Prevents flaky test failures on Windows CI/CD pipeline

Signed-off-by: affonsov <[email protected]>
…lide tests

- Prevents timeout issues during integration test execution with large payloads

Signed-off-by: affonsov <[email protected]>
Signed-off-by: affonsov <[email protected]>
…ry nodes instead of all nodes"

This reverts commit df2256a.

Signed-off-by: affonsov <[email protected]>
…n GitHub Actions WSL environment

Signed-off-by: affonsov <[email protected]>
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