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

Grails test-app -integration not honoring the port number specified #9970

Closed
4 tasks done
sr-nu opened this issue May 31, 2016 · 3 comments
Closed
4 tasks done

Grails test-app -integration not honoring the port number specified #9970

sr-nu opened this issue May 31, 2016 · 3 comments
Milestone

Comments

@sr-nu
Copy link

sr-nu commented May 31, 2016

Grails integration tests are not honoring the port number configured. Only run-app is using the specified port, but not test-app

Task List

  • Steps to reproduce provided
  • Stacktrace
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

1 . create an integration test
2. start an application which is bound to 8080
3. grails test-app -integration //fails
OR
grails --server.port=9999 test-app -integration //fails
OR
grails --port=9999 test-app -integration //fails
OR
application.yml
server:
port: 9999
grails test-app -integration //fails
4. Using environmental variable
SERVER_PORT=9999 grails test-app -integration //PASSED

Stacktrace

Stack trace:
java.lang.IllegalStateException
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException
Caused by: java.lang.IllegalStateException

Expected Behaviour

test-app should honor all methods of port configuration supported by run-app

Actual Behaviour

Tries to bind to 8080, fails with an exception

Environment Information

|Grails Version: 3.1.5
|Groovy Version: 2.4.6
|JVM Version: 1.8.0_60

Example Application

  • TODO: link to github repository with example that reproduces the issue
@graemerocher
Copy link
Member

The correct fix here is actually to use a random port

@sr-nu
Copy link
Author

sr-nu commented May 31, 2016

Even using PORT=0 (random port) in above variables has same behaviour. So, underlying issue is, only environmental variable is honored. Other supported was are not working for test-app

@sr-nu
Copy link
Author

sr-nu commented May 31, 2016

Seems like a regression bug in 3.1.5

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

No branches or pull requests

2 participants