테스트 함수 수정

This commit is contained in:
2023-07-10 12:28:32 +09:00
parent b5a72aad05
commit bfebc67eb7

View File

@ -2,6 +2,7 @@ package rpc
import ( import (
"context" "context"
"math/rand"
"testing" "testing"
"time" "time"
@ -20,12 +21,12 @@ func (tr *testReceiver) TargetExists(tid primitive.ObjectID) bool {
func (tr *testReceiver) TestFunc(a string, b string, c int) { func (tr *testReceiver) TestFunc(a string, b string, c int) {
target := primitive.NewObjectID() target := primitive.NewObjectID()
target[0] = 0 target[0] = byte(rand.Intn(2) * 20)
if CallOrGo(tr, target, a, b) != ErrCanExecuteHere { if CallOrGo(tr, target, a, b) != ErrCanExecuteHere {
return return
} }
logger.Println(" ", a, b) logger.Println(" ", a, b, target[0])
} }
func TestRpc(t *testing.T) { func TestRpc(t *testing.T) {