Merge pull request #189288 from roblabla/buf-fix-flakey-test

buf: Patch out flakey test
This commit is contained in:
Arnout Engelen 2022-09-05 15:01:04 +02:00 committed by GitHub
commit b3bd5abf2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View file

@ -26,6 +26,10 @@ buildGoModule rec {
./skip_test_requiring_network.patch
# Skip TestWorkspaceGit which requires .git and commits.
./skip_test_requiring_dotgit.patch
# Skips the invalid_upstream test as it is flakey. Based on upstream commit
# 27930caf2eb35c2592a77f59ed5afe4d9e2fb7ea.
# This patch may be removed on the next buf update.
./skip_test_invalid_upstream_flakey.patch
];
nativeBuildInputs = [ installShellFiles ];

View file

@ -0,0 +1,24 @@
diff --git a/private/bufpkg/bufstudioagent/bufstudioagent_test.go b/private/bufpkg/bufstudioagent/bufstudioagent_test.go
index 6e010937..9cacc082 100644
--- a/private/bufpkg/bufstudioagent/bufstudioagent_test.go
+++ b/private/bufpkg/bufstudioagent/bufstudioagent_test.go
@@ -186,6 +186,19 @@ func testPlainPostHandlerErrors(t *testing.T, upstreamServer *httptest.Server) {
})
t.Run("invalid_upstream", func(t *testing.T) {
+ // TODO: unskip this test. This is flaky because of two reasons:
+ //
+ // 1. When a connection is closed, the underlying HTTP client does not
+ // always knows it, since the http handler implementation in go has no way
+ // of changing the connection timeout. See:
+ // https://github.com/golang/go/issues/16100
+ //
+ // 2. The expected status code is `StatusBadGateway` since the issue
+ // happened client-side (a response never came back from the server). This
+ // is not deterministic in the business logic because we're based on the
+ // connect error code that's returned. See
+ // https://linear.app/bufbuild/issue/BSR-383/flaky-test-in-bufstudioagent-testgo
+ t.SkipNow()
listener, err := net.Listen("tcp", "127.0.0.1:")
require.NoError(t, err)
go func() {