Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a substitute function for execution on Windows OS #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

woohyun-jeong
Copy link

What is this PR for?

The executeGrepProcessWindowCommand function can be used as a replacement for the executeGrepProcessCommand function when running on Windows OS.

Overview or reasons

  • Please explain the contents.
    Add a function for testing the server on Windows OS.

Tasks

  • Please explain what did you do.
    Add executeGrepProcessWindowCommand function to EmbeddedRedisServerConfiguration class.

Result

  • Please Describe the result
    Verify proper functionality on Windows OS with executeGrepProcessWindowCommand function.

The original error was as follows: Cannot run program "/bin/sh": CreateProcess error=2
window_error

After taking action, it now appears as follows:Completed
window_success

The code in the EmbeddedRedisServerConfiguration class needs to be modified when running on Windows OS.

private boolean isRedisRunning() throws IOException {
        return isRunning(executeGrepProcessWindowCommand(redisPort));
    }
public int findAvailablePort() throws IOException {

        for (int port = 10000; port <= 65535; port++) {
            Process process = executeGrepProcessWindowCommand(port);
            if (!isRunning(process)) {
                return port;
            }
        }

        throw new IllegalArgumentException("Not Found Available port: 10000 ~ 65535");
    }

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants