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

When running a FeatureTest a lot of data is dumped to stdout and stderr #226

Closed
thomas-rc-hutchinson opened this issue Aug 3, 2015 · 2 comments

Comments

@thomas-rc-hutchinson
Copy link

commented Aug 3, 2015

When running a com.twitter.inject.server.FeatureTest a lot of data is dumped to stdout and stderr. I've looked at the code in com.twitter.inject.app.{EmbeddedApp, Banner} (sure there are other classes to) and there doesn't seem to be a way to disable it. This isn't major but it would be nice to reduce the noise when reviewing log statements when running tests.

@scosenza

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2015

Have you tried setting "suppress=true" on each httpX method?

On Monday, August 3, 2015, thomas-rc-hutchinson notifications@github.com
wrote:

When running a com.twitter.inject.server.FeatureTest a lot of data is
dumped to stdout and stderr. I've looked at the code in
com.twitter.inject.app.{EmbeddedApp, Banner} (sure there are other classes
to) and there doesn't seem to be a way to disable it. This isn't major but
it would be nice to reduce the noise when reviewing log statements when
running tests.


Reply to this email directly or view it on GitHub
#226.

-Steve

Sent from Gmail Mobile

@thomas-rc-hutchinson

This comment has been minimized.

Copy link
Author

commented Aug 4, 2015

I tried this and some request response information was removed but the rest wasn't. Here is what I got.

Removed when suppress=true

===========================================================================
            HTTP GET /v1/json
            [Header]    Host -> 127.0.0.1:57867
===========================================================================


[Status]    500 Internal Server Error
[Header]    Content-Length -> 0
*EmptyBody*

All entries when suppress is not set


===========================================================================
HTTP GET /v1/json
[Header]    Host -> 127.0.0.1:57867
===========================================================================
2015-08-04 10:50:31,763 INF 28426f162faa992d          WurflController           Entering /v1/json with Mozil1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
2015-08-04 10:50:31,764 ERR 28426f162faa992d          WurflController           Failure FailureThatIsNotHandled() can't be handled
---------------------------------------------------------------------------
[Status]    500 Internal Server Error
[Header]    Content-Length -> 0
*EmptyBody*
Starting com.wh.wurfl.WurflServer with args: -admin.port=127.0.0.1:0 -log.level=INFO -http.port=127.0.0.1:0
Waiting for warmup phases to complete...
2015-08-04 10:50:29,282 INF                           WurflServer               Process started
I 0804 08:50:29.474 THREAD12: HttpMuxer[/admin/metrics.json] = com.twitter.finagle.stats.MetricsExporter(<function1>)
I 0804 08:50:29.501 THREAD12: HttpMuxer[/admin/per_host_metrics.json] = com.twitter.finagle.stats.HostMetricsExporter(<function1>)
I 0804 08:50:29.556 THREAD12: /admin => com.twitter.server.handler.SummaryHandler
I 0804 08:50:29.557 THREAD12: /admin/server_info => com.twitter.finagle.Filter$$anon$1
I 0804 08:50:29.557 THREAD12: /admin/contention => com.twitter.finagle.Filter$$anon$1
I 0804 08:50:29.557 THREAD12: /admin/threads => com.twitter.server.handler.ThreadsHandler
I 0804 08:50:29.557 THREAD12: /admin/threads.json => com.twitter.server.handler.ThreadsHandler
I 0804 08:50:29.557 THREAD12: /admin/announcer => com.twitter.finagle.Filter$$anon$1
I 0804 08:50:29.558 THREAD12: /admin/dtab => com.twitter.finagle.Filter$$anon$1
I 0804 08:50:29.558 THREAD12: /admin/pprof/heap => com.twitter.server.handler.HeapResourceHandler
I 0804 08:50:29.558 THREAD12: /admin/pprof/profile => com.twitter.server.handler.ProfileResourceHandler
I 0804 08:50:29.558 THREAD12: /admin/pprof/contention => com.twitter.server.handler.ProfileResourceHandler
I 0804 08:50:29.558 THREAD12: /admin/ping => com.twitter.server.handler.ReplyHandler
I 0804 08:50:29.559 THREAD12: /admin/shutdown => com.twitter.server.handler.ShutdownHandler
I 0804 08:50:29.559 THREAD12: /admin/tracing => com.twitter.server.handler.TracingHandler
I 0804 08:50:29.559 THREAD12: /admin/events => com.twitter.server.handler.EventsHandler
I 0804 08:50:29.560 THREAD12: /admin/logging => com.twitter.server.handler.LoggingHandler
I 0804 08:50:29.560 THREAD12: /admin/metrics => com.twitter.server.handler.MetricQueryHandler
I 0804 08:50:29.560 THREAD12: /admin/clients/ => com.twitter.server.handler.ClientRegistryHandler
I 0804 08:50:29.561 THREAD12: /admin/servers/ => com.twitter.server.handler.ServerRegistryHandler
I 0804 08:50:29.561 THREAD12: /admin/files/ => com.twitter.server.handler.ResourceHandler
I 0804 08:50:29.562 THREAD12: /admin/registry.json => com.twitter.server.handler.RegistryHandler
I 0804 08:50:29.564 THREAD12: Serving admin http on localhost.localdomain/127.0.0.1:0
I 0804 08:50:29.585 THREAD12: Finagle version 6.25.0 (rev=78909170b7cc97044481274e297805d770465110) built at 20150423-135046
2015-08-04 10:50:30,276 INF                           WurflServer               Resolving Finagle clients before warmup
Waiting for warmup phases to complete...
2015-08-04 10:50:30,285 INF                           WurflServer               Done resolving clients: [].
2015-08-04 10:50:30,443 INF                           WurflServer               Warming up.
2015-08-04 10:50:30,727 INF                           WurflServer               http server started on port: 57867
2015-08-04 10:50:30,727 INF                           WurflServer               Enabling health endpoint on port 50683
2015-08-04 10:50:30,728 INF                           WurflServer               App started.
2015-08-04 10:50:30,728 INF                           WurflServer               Startup complete, server ready.
Waiting for warmup phases to complete...


===========================================================================
Server Started: com.wh.wurfl.WurflServer
===========================================================================
AdminHttp    -> http://127.0.0.1:50683/admin
ExternalHttp -> http://127.0.0.1:57867


===========================================================================
com.wh.wurfl.WurflServer Stats
===========================================================================
http/request_latency_ms  = Avg 293.0 with values 293.0
http/handletime_us   = Avg 5679.0 with values 5679.0
response_size    = Avg 0.0 with values 0.0
route/WurflController/GET/response_size  = Avg 0.0 with values 0.0
route/WurflController/GET/time/500   = Avg 289.0 with values 289.0
route/WurflController/GET/time/5XX   = Avg 289.0 with values 289.0
time/5XX     = Avg 289.0 with values 289.0
time/500     = Avg 289.0 with values 289.0
http/received_bytes  = 179
http/requests    = 1
http/success     = 1
http/connects    = 1
http/sent_bytes  = 57
route/WurflController/GET/requests   = 1
route/WurflController/GET/status/500     = 1
route/WurflController/GET/status/5XX     = 1
status/5XX   = 1
status/500   = 1
http/connections     = <function0>
http/pending     = <function0>
http/load    = <function0>


===========================================================================
Closing EmbeddedApp for class com.wh.wurfl.WurflServer
===========================================================================

Process finished with exit code 0

Test

   override val server = new EmbeddedHttpServer(new WurflServer(Seq(WurflAPIThatReturnsFailureThatIsntHandled)))

 "Server" should {
    "ping" in {
      server.httpGet(
        path = "/v1/json",
        headers = Map("User-Agent" -> "Mozil1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3"),
        andExpect = InternalServerError)
    }
  }

The information I would like to disable is the admin endpoints that are register and the stats at the bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.