Skip to content

Commit

Permalink
Cleanup and don't test
Browse files Browse the repository at this point in the history
  • Loading branch information
zasweq committed Jun 4, 2024
1 parent feda558 commit fdbd01b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
3 changes: 0 additions & 3 deletions examples/examples_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ EXAMPLES=(
"features/metadata_interceptor"
"features/multiplex"
"features/name_resolving"
"features/opentelemetry"
"features/orca"
"features/retry"
"features/unix_abstract"
Expand Down Expand Up @@ -123,7 +122,6 @@ declare -A EXPECTED_SERVER_OUTPUT=(
["features/metadata_interceptor"]="key1 from metadata: "
["features/multiplex"]=":50051"
["features/name_resolving"]="serving on localhost:50051"
["features/opentelemetry"]="serving on :50051"
["features/orca"]="Server listening"
["features/retry"]="request succeeded count: 4"
["features/unix_abstract"]="serving on @abstract-unix-socket"
Expand All @@ -148,7 +146,6 @@ declare -A EXPECTED_CLIENT_OUTPUT=(
["features/metadata_interceptor"]="BidiStreaming Echo: hello world"
["features/multiplex"]="Greeting: Hello multiplex"
["features/name_resolving"]="calling helloworld.Greeter/SayHello to \"example:https:///resolver.example.grpc.io\""
["features/opentelemetry"]="this is examples/opentelemetry (from :50051)" # does this need to exit to work?
["features/orca"]="Per-call load report received: map\[db_queries:10\]"
["features/retry"]="UnaryEcho reply: message:\"Try and Success\""
["features/unix_abstract"]="calling echo.Echo/UnaryEcho to unix-abstract:abstract-unix-socket"
Expand Down
2 changes: 1 addition & 1 deletion examples/features/customloadbalancer/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func main() {
mr.InitialState(resolver.State{
Endpoints: []resolver.Endpoint{
{Addresses: []resolver.Address{{Addr: addr1}}},
{Addresses: []resolver.Address{{Addr: addr2}}}, // Do I need the addresses for this one?
{Addresses: []resolver.Address{{Addr: addr2}}},
},
ServiceConfig: sc,
})
Expand Down
9 changes: 2 additions & 7 deletions examples/features/opentelemetry/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,9 @@ func main() {
provider := metric.NewMeterProvider(
metric.WithReader(exporter),
)
// why 64 for interop 65 for example?
go http.ListenAndServe(*promAddr, promhttp.Handler())

/*ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()*/
// play around to see if examples pass with this - unbounded
ctx := context.Background()

do := opentelemetry.DialOption(opentelemetry.Options{MetricsOptions: opentelemetry.MetricsOptions{MeterProvider: provider}})

cc, err := grpc.NewClient(*addr, grpc.WithTransportCredentials(insecure.NewCredentials()), do)
Expand All @@ -69,11 +64,11 @@ func main() {
// Make a RPC every second. This should trigger telemetry to be emitted from
// the client and the server.
for {
r, err := c.UnaryEcho(ctx, &echo.EchoRequest{Message: "this is examples/opentelemetry"}) // do I need to rename, any call options? echopb etc. Requires 1.21, but not unstable exporter not in g3
r, err := c.UnaryEcho(ctx, &echo.EchoRequest{Message: "this is examples/opentelemetry"})
if err != nil {
log.Fatalf("UnaryEcho failed: %v", err)
}
fmt.Println(r) // Does this need to exit to pass examples test? I think I just run bash script to run examples test. Does example test need determinstic output from this? Does the read me need to be deterministic output?
fmt.Println(r)
time.Sleep(time.Second)
}
}
2 changes: 1 addition & 1 deletion examples/helloworld/greeter_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

var (
port = flag.Int("port", 50051, "The server port") // The port only is the variable thing...
port = flag.Int("port", 50051, "The server port")
)

// server is used to implement helloworld.GreeterServer.
Expand Down

0 comments on commit fdbd01b

Please sign in to comment.