// Purpose of this test is to ensure introspection doesn't cause any panics
// and we have coverage of the introspection code.
Purpose of this test is to ensure introspection doesn't cause any panics
and we have coverage of the introspection code.
// Purpose of this test is to ensure introspection doesn ' t cause any panics // and we have coverage of the introspection code .
func TestIntrospection(t *testing.T) {
	opts := testutils.NewOpts().
		AddLogFilter("Couldn't find handler", 1). 
		NoRelay()                                 
	testutils.WithTestServer(t, opts, func(t testing.TB, ts *testutils.TestServer) {
		client := testutils.NewClient(t, nil)
		defer client.Close()
		ctx, cancel := json.NewContext(time.Second)
		defer cancel()
		var resp map[string]interface{}
		peer := client.Peers().GetOrAdd(ts.HostPort())
		err := json.CallPeer(ctx, peer, "tchannel", "_gometa_introspect", map[string]interface{}{
			"includeExchanges":  true,
			"includeEmptyPeers": true,
			"includeTombstones": true,
		}, &resp)
		require.NoError(t, err, "Call _gometa_introspect failed")
		err = json.CallPeer(ctx, peer, ts.ServiceName(), "_gometa_introspect", nil , &resp)
		require.NoError(t, err, "Call _gometa_introspect failed")
		err = json.CallPeer(ctx, peer, "unknown-service", "_gometa_runtime", map[string]interface{}{
			"includeGoStacks": true,
		}, &resp)
		require.Error(t, err, "_gometa_introspect should only be registered under tchannel")
	})
}
func TestIntrospection ( t * testing . T ) { opts := testutils . NewOpts ( ) . AddLogFilter ( " " , 1 ) . NoRelay ( ) testutils . WithTestServer ( t , opts , func ( t testing . TB , ts * testutils . TestServer ) { client := testutils . NewClient ( t , nil ) defer client . Close ( ) ctx , cancel := json . NewContext ( time . Second ) defer cancel ( ) var resp map [ string ] interface { } peer := client . Peers ( ) . GetOrAdd ( ts . HostPort ( ) ) err := json . CallPeer ( ctx , peer , " " , " " , map [ string ] interface { } { " " : true , " " : true , " " : true , } , & resp ) require . NoError ( t , err , " " ) err = json . CallPeer ( ctx , peer , ts . ServiceName ( ) , " " , nil , & resp ) require . NoError ( t , err , " " ) err = json . CallPeer ( ctx , peer , " " , " " , map [ string ] interface { } { " " : true , } , & resp ) require . Error ( t , err , " " ) } ) }
Purpose of this test is to ensure introspection doesn't cause any panics
and we have coverage of the introspection code.
Purpose of this test is to ensure introspection doesn ' t cause any panics and we have coverage of the introspection code .
// call with service name fails // "tchannel" service name is not forwarded. /* arg */ // Try making the call on any other service name will fail.