{"record":{"id":"fb4e24fce1d3a6aa","repo":"temporalio/temporal","slug":"unimplemented-in-the-nettest-package","errorCode":null,"errorMessage":"unimplemented in the nettest package","messagePattern":"unimplemented in the nettest package","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/testing/nettest/rpc_factory.go","lineNumber":50,"sourceCode":"\nfunc (f *RPCFactory) GetInternodeGRPCServerOptions() ([]grpc.ServerOption, error) {\n\treturn nil, nil\n}\n\nfunc (f *RPCFactory) GetGRPCListener() net.Listener {\n\treturn f.listener\n}\n\nfunc (f *RPCFactory) CreateRemoteFrontendGRPCConnection(rpcAddress string) *grpc.ClientConn {\n\treturn f.dial(rpcAddress)\n}\n\nfunc (f *RPCFactory) CreateLocalFrontendGRPCConnection() *grpc.ClientConn {\n\treturn f.dial(f.listener.Addr().String())\n}\n\nfunc (f *RPCFactory) CreateLocalFrontendHTTPClient() (*common.FrontendHTTPClient, error) {\n\tpanic(\"unimplemented in the nettest package\")\n}\n\nfunc (f *RPCFactory) CreateHistoryGRPCConnection(rpcAddress string) *grpc.ClientConn {\n\treturn f.dial(rpcAddress)\n}\n\nfunc (f *RPCFactory) CreateMatchingGRPCConnection(rpcAddress string) *grpc.ClientConn {\n\treturn f.dial(rpcAddress)\n}\n\nfunc (f *RPCFactory) dial(rpcAddress string) *grpc.ClientConn {\n\tdialOptions := append(f.dialOptions,\n\t\tgrpc.WithContextDialer(func(ctx context.Context, s string) (net.Conn, error) {\n\t\t\treturn f.listener.Connect(ctx.Done())\n\t\t}),\n\t\tgrpc.WithTransportCredentials(insecure.NewCredentials()),\n\t)\n\tconn, err := grpc.NewClient(","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/testing/nettest/rpc_factory.go#L32-L68","documentation":"The nettest RPCFactory is a lightweight in-memory factory for integration tests; it implements gRPC connection creation but deliberately panics on CreateLocalFrontendHTTPClient, since HTTP frontend clients are unimplemented in this package. Hitting the panic means calling an API this factory does not support.","triggerScenarios":"Calling CreateLocalFrontendHTTPClient() on common/testing/nettest.RPCFactory — typically a test exercising the Temporal frontend over HTTP with the nettest factory.","commonSituations":"Tests extended to cover the frontend HTTP API while reusing the nettest factory; accidentally wiring nettest.RPCFactory where a real/other factory supporting HTTP is expected.","solutions":["Use a different RPC factory implementation (e.g. the real service factory) for HTTP frontend client tests.","Rewrite the test to use CreateLocalFrontendGRPCConnection and the gRPC frontend client instead of HTTP.","Implement CreateLocalFrontendHTTPClient in nettest if HTTP support is genuinely required (contribute the change)."],"exampleFix":"// before\nclient, err := rpcFactory.CreateLocalFrontendHTTPClient()\n// after\nconn := rpcFactory.CreateLocalFrontendGRPCConnection()\nclient := frontendv1.NewWorkflowServiceClient(conn)","handlingStrategy":"validation","validationCode":"var f interface{ CreateLocalFrontendHTTPClient() (*common.FrontendHTTPClient, error) } = rpcFactory\n_ = f // only call if factory actually supports HTTP; nettest does not","typeGuard":"func supportsHTTPClient(f interface{}) bool {\n\ttype httpFactory interface{ CreateLocalFrontendHTTPClient() (*common.FrontendHTTPClient, error) }\n\t_, ok := f.(httpFactory)\n\treturn ok && !isNettestFactory(f) // nettest implements it but panics\n}","tryCatchPattern":null,"preventionTips":["Check which factory implementation a test harness provides before using HTTP clients.","Prefer the gRPC connection APIs when using nettest."],"tags":["testing","http","grpc","unimplemented"],"backgroundTag":"unimplemented-method-panic","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}