aboutsummaryrefslogtreecommitdiff
path: root/internal/testing
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-09-01 07:22:46 -0400
committerJonathan Amsterdam <jba@google.com>2021-09-01 14:16:41 +0000
commitbb6da5216eba144f9891c1c0dd2228fdbfa45163 (patch)
tree230b553713bffd364321db456594aa70026c8dca /internal/testing
parent6e28a50e59803c0b1f05ca9e18a38d33b9e2868b (diff)
downloadgo-x-pkgsite-bb6da5216eba144f9891c1c0dd2228fdbfa45163.tar.xz
internal/{worker/fetch}: include DB activity in load-shedding
Move the load-shedding logic to the worker and have it span both the fetch and processing of the module (as previously) as well as inserting it into the database. This is a more accurate estimation of load, since running a lot of concurrent queries definitely slows down processing. Most of the time this won't make much difference, but under high load, such as when processing multiple large modules, it will reduce DB contention and should result in greater throughput. For golang/go#48010 Change-Id: I7d0922e02d00182e867fd3b29fc284c32ecab5ee Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/346749 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/testing')
-rw-r--r--internal/testing/integration/frontend_test.go1
1 files changed, 0 insertions, 1 deletions
diff --git a/internal/testing/integration/frontend_test.go b/internal/testing/integration/frontend_test.go
index c64bbb66..ffeb9783 100644
--- a/internal/testing/integration/frontend_test.go
+++ b/internal/testing/integration/frontend_test.go
@@ -100,7 +100,6 @@ func processVersions(ctx context.Context, t *testing.T, testModules []*proxytest
func fetchAndInsertModule(ctx context.Context, t *testing.T, tm *proxytest.Module, proxyClient *proxy.Client) {
sourceClient := source.NewClient(1 * time.Second)
res := fetch.FetchModule(ctx, tm.ModulePath, tm.Version, fetch.NewProxyModuleGetter(proxyClient), sourceClient)
- defer res.Defer()
if res.Error != nil {
t.Fatal(res.Error)
}