Skip to content

Commit

Permalink
comment uring test and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Aug 5, 2023
1 parent 6889a78 commit 3d6efee
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 54 deletions.
12 changes: 0 additions & 12 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Official site: [http://rpcx.io](http://rpcx.io/)

[![License](https://img.shields.io/:license-apache%202-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![GoDoc](https://godoc.org/github.com/smallnest/rpcx?status.png)](http://godoc.org/github.com/smallnest/rpcx) [![travis](https://travis-ci.org/smallnest/rpcx.svg?branch=master)](https://travis-ci.org/smallnest/rpcx) [![Go Report Card](https://goreportcard.com/badge/github.com/smallnest/rpcx)](https://goreportcard.com/report/github.com/smallnest/rpcx) [![coveralls](https://coveralls.io/repos/smallnest/rpcx/badge.svg?branch=master&service=github)](https://coveralls.io/github/smallnest/rpcx?branch=master) [![QQ3็พค](https://img.shields.io/:QQ3็พค-953962236-blue.svg)](_documents/rpcx_dev_qq3.jpg)
[![License](https://img.shields.io/:license-apache%202-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![GoDoc](https://godoc.org/github.com/smallnest/rpcx?status.png)](http://godoc.org/github.com/smallnest/rpcx) [![github actions](https://github.com/smallnest/rpcx/actions)](https://github.com/smallnest/rpcx/actions/workflows/go.yml/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/smallnest/rpcx)](https://goreportcard.com/report/github.com/smallnest/rpcx) [![coveralls](https://coveralls.io/repos/smallnest/rpcx/badge.svg?branch=master&service=github)](https://coveralls.io/github/smallnest/rpcx?branch=master) [![QQ3็พค](https://img.shields.io/:QQ3็พค-953962236-blue.svg)](_documents/rpcx_dev_qq3.jpg)

**Notice: etcd**

Expand Down
74 changes: 33 additions & 41 deletions client/connection_iouring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,36 @@

package client

import (
"context"
"testing"
"time"

"github.com/smallnest/rpcx/server"
)

func TestXClient_IOUring(t *testing.T) {
s := server.NewServer()
s.RegisterName("Arith", new(Arith), "")
go s.Serve("iouring", "127.0.0.1:8972")
defer s.Close()
time.Sleep(500 * time.Millisecond)

addr := s.Address().String()

d, err := NewPeer2PeerDiscovery("iouring@"+addr, "desc=a test service")
if err != nil {
t.Fatalf("failed to NewPeer2PeerDiscovery: %v", err)
}

xclient := NewXClient("Arith", Failtry, RandomSelect, d, DefaultOption)

defer xclient.Close()

args := &Args{
A: 10,
B: 20,
}

reply := &Reply{}
err = xclient.Call(context.Background(), "Mul", args, reply)
if err != nil {
t.Fatalf("failed to call: %v", err)
}

if reply.C != 200 {
t.Fatalf("expect 200 but got %d", reply.C)
}
}
// func TestXClient_IOUring(t *testing.T) {
// s := server.NewServer()
// s.RegisterName("Arith", new(Arith), "")
// go s.Serve("iouring", "127.0.0.1:8972")
// defer s.Close()
// time.Sleep(500 * time.Millisecond)

// addr := s.Address().String()

// d, err := NewPeer2PeerDiscovery("iouring@"+addr, "desc=a test service")
// if err != nil {
// t.Fatalf("failed to NewPeer2PeerDiscovery: %v", err)
// }

// xclient := NewXClient("Arith", Failtry, RandomSelect, d, DefaultOption)

// defer xclient.Close()

// args := &Args{
// A: 10,
// B: 20,
// }

// reply := &Reply{}
// err = xclient.Call(context.Background(), "Mul", args, reply)
// if err != nil {
// t.Fatalf("failed to call: %v", err)
// }

// if reply.C != 200 {
// t.Fatalf("expect 200 but got %d", reply.C)
// }
// }

0 comments on commit 3d6efee

Please sign in to comment.