Skip to content

Test case bug, a contradiction in its logic. #2659

@YarBor

Description

@YarBor

Environment

  • Server: Dubbo-go, v3.1.1
  • Client: Dubbo-go, v3.1.1

Issue description

When submitting PR, there is a certain probability that this test case will go wrong.
There is a contradiction in its logic.

	t.Run("sum_error", func(t *testing.T) {
		stream, err := client.Sum(context.Background())
		assert.Nil(t, err)
                // If this assertion is passed, an error will be reported in the following case
		if sendErr := stream.Send(&pingv1.SumRequest{Number: 1}); sendErr != nil {
			assert.ErrorIs(t, err, io.EOF)  // mey sendErr
	                assert.Equal(t, triple.CodeOf(err), triple.CodeUnknown) // mey sendErr
               	}
		err = stream.CloseAndReceive(triple.NewResponse(&pingv1.SumResponse{}))
		assert.Equal(t, triple.CodeOf(err), triple.CodeInvalidArgument)
	})

code link

https://github.com/apache/dubbo-go/blob/1f7eb1180cd9864aa52003b9f9cb11e8549b9a86/protocol/triple/triple_protocol/triple_ext_test.go#L166C1-L175C5

Logs

Click me to check logs
Copy logs to here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions