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

SpringBootWatcherIntegrationTest is failing on windows #3178

Closed
1 task
rohanKanojia opened this issue Jun 19, 2024 · 1 comment · Fixed by #3191
Closed
1 task

SpringBootWatcherIntegrationTest is failing on windows #3178

rohanKanojia opened this issue Jun 19, 2024 · 1 comment · Fixed by #3191
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@rohanKanojia
Copy link
Member

Component

JKube Kit

Task description

Description

Related to #1338

⚠️ A windows machine is required to reproduce and fix problems in this issue

SpringBootWatcherIntegrationTest.withAllRequirementsShouldStartWatcherProcess is failing on windows as it's trying to run a bash script on windows.

@Test
void withAllRequirementsShouldStartWatcherProcess() throws Exception {

Error:  Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.699 s <<< FAILURE! -- in org.eclipse.jkube.springboot.watcher.SpringBootWatcherIntegrationTest
INFO: MockWebServer[51159] received request: GET /api/v1/namespaces/test/pods?allowWatchBookmarks=true&labelSelector=app%3Dspring-boot-test&resourceVersion=0&timeoutSeconds=600&watch=true HTTP/1.1 and responded: HTTP/1.1 101 Switching Protocols
Error:  org.eclipse.jkube.springboot.watcher.SpringBootWatcherIntegrationTest.withAllRequirementsShouldStartWatcherProcess -- Time elapsed: 0.225 s <<< ERROR!
Jun 19, 2024 9:36:32 AM okhttp3.mockwebserver.MockWebServer$3 processOneRequest
INFO: MockWebServer[51159] received request: GET /api/v1/namespaces/test/pods?allowWatchBookmarks=true&labelSelector=app%3Dspring-boot-test&watch=true HTTP/1.1 and responded: HTTP/1.1 101 Switching Protocols
Jun 19, 2024 9:36:32 AM okhttp3.mockwebserver.MockWebServer$2 acceptConnections
INFO: MockWebServer[51153] done accepting connections: Socket closed
org.eclipse.jkube.kit.common.JKubeException: Failed to run RemoteSpringApplication: java.io.IOException: Failed to start 'C:\Users\RUNNER~1\AppData\Local\Temp\junit10238769324043280767\java-home\bin\java -cp C:\Users\runneradmin\AppData\Local\Temp\junit10238769324043280767\target\spring-boot-lib.jar;C:\Users\runneradmin\AppData\Local\Temp\junit10238769324043280767\target\spring-boot-devtools.jar -Dspring.devtools.remote.secret=this-is-a-test org.springframework.boot.devtools.RemoteSpringApplication http://localhost:52813' : Cannot run program "C:\Users\RUNNER~1\AppData\Local\Temp\junit10238769324043280767\java-home\bin\java": CreateProcess error=193, %1 is not a valid Win32 application
	at org.eclipse.jkube.springboot.watcher.SpringBootWatcher.runRemoteSpringApplication(SpringBootWatcher.java:148)
	at org.eclipse.jkube.springboot.watcher.SpringBootWatcher.watch(SpringBootWatcher.java:89)
	at org.eclipse.jkube.springboot.watcher.SpringBootWatcherIntegrationTest.withAllRequirementsShouldStartWatcherProcess(SpringBootWatcherIntegrationTest.java:145)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.io.IOException: Failed to start 'C:\Users\RUNNER~1\AppData\Local\Temp\junit10238769324043280767\java-home\bin\java -cp C:\Users\runneradmin\AppData\Local\Temp\junit10238769324043280767\target\spring-boot-lib.jar;C:\Users\runneradmin\AppData\Local\Temp\junit10238769324043280767\target\spring-boot-devtools.jar -Dspring.devtools.remote.secret=this-is-a-test org.springframework.boot.devtools.RemoteSpringApplication http://localhost:52813' : Cannot run program "C:\Users\RUNNER~1\AppData\Local\Temp\junit10238769324043280767\java-home\bin\java": CreateProcess error=193, %1 is not a valid Win32 application
	at org.eclipse.jkube.kit.common.ExternalCommand.startProcess(ExternalCommand.java:119)
	at org.eclipse.jkube.kit.common.ExternalCommand.execute(ExternalCommand.java:59)
	at org.eclipse.jkube.kit.common.ExternalCommand.execute(ExternalCommand.java:55)
	at org.eclipse.jkube.springboot.watcher.SpringBootWatcher.runRemoteSpringApplication(SpringBootWatcher.java:146)
	... 5 more
Caused by: java.io.IOException: Cannot run program "C:\Users\RUNNER~1\AppData\Local\Temp\junit10238769324043280767\java-home\bin\java": CreateProcess error=193, %1 is not a valid Win32 application
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at java.base/java.lang.Runtime.exec(Runtime.java:594)
	at org.eclipse.jkube.kit.common.ExternalCommand.startProcess(ExternalCommand.java:117)
	... 8 more
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
	at java.base/java.lang.ProcessImpl.create(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:499)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 11 more

This test was not written to be run on Windows Operating System. We should disable it on windows

Expected Behavior

Use JUnit5 DisableOnOS annotation to disable test on windows

Acceptance Criteria

  • SpringBootWatcherIntegrationTest.withAllRequirementsShouldStartWatcherProcess is disabled on windows with JUnit5 DisableOnOS annotation
@rohanKanojia rohanKanojia added good first issue Good for newcomers help wanted Extra attention is needed labels Jun 19, 2024
@l3002
Copy link
Contributor

l3002 commented Jun 20, 2024

Hi @rohanKanojia : Kindly assign this to me.

@manusa manusa added this to the 1.17.0 milestone Jun 25, 2024 — with automated-tasks
manusa pushed a commit that referenced this issue Jun 25, 2024
…tion test on windows (3191)

chore(test): disabled failing test on Windows

Signed-off-by: l3002 <tanmaymathpal4545@gmail.com>
---
Merge branch 'eclipse-jkube:master' into Issue-Fix-#3178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants