Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
YarBor opened this issue Apr 11, 2024 · 0 comments
Closed

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

YarBor opened this issue Apr 11, 2024 · 0 comments

Comments

@YarBor
Copy link
Contributor

YarBor commented Apr 11, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant