tianxiaoliang commented on a change in pull request #1259:
URL:
https://github.com/apache/servicecomb-service-center/pull/1259#discussion_r805223905
##########
File path: server/service/disco/instance_test.go
##########
@@ -1862,13 +1863,26 @@ func TestSendHeartbeat(t *testing.T) {
})
t.Run("when update a lease, should be passed", func(t *testing.T) {
- err := discosvc.SendHeartbeat(ctx, &pb.HeartbeatRequest{
+ resp, err := discosvc.GetInstance(ctx,
&pb.GetOneInstanceRequest{ProviderServiceId: serviceId, ProviderInstanceId:
instanceId1})
+ assert.NoError(t, err)
+ resp.Instance.Properties = nil
+
+ err = discosvc.PutInstance(ctx,
&pb.RegisterInstanceRequest{Instance: resp.Instance})
+ assert.NoError(t, err)
+
+ err = discosvc.SendHeartbeat(ctx, &pb.HeartbeatRequest{
ServiceId: serviceId,
InstanceId: instanceId1,
})
assert.NoError(t, err)
- err = discosvc.SendHeartbeat(ctx, &pb.HeartbeatRequest{
+ resp, err = discosvc.GetInstance(ctx,
&pb.GetOneInstanceRequest{ProviderServiceId: serviceId, ProviderInstanceId:
instanceId1})
+ assert.NoError(t, err)
+ assert.Equal(t, "test_engineID",
resp.Instance.Properties["engineID"])
+ })
+
+ t.Run("when update lease with invalid request, should be failed",
func(t *testing.T) {
Review comment:
case name is wrong
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]