Run the slow test packages in shards and stop compiling the standard library per judge test (hq issue 717)
mesh/merge-gate head 3ec4473b29b2 merged into trunk df8c1ccf1fff — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head 3ec4473b29b2 merged into trunk df8c1ccf1fff — pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh): main's version judged it; the ch…
mesh/delivery delivered
mesh/merge-gate head 3ec4473b29b2 merged into trunk df8c1ccf1fff — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head 3ec4473b29b2 merged into trunk df8c1ccf1fff — pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh): main's version judged it; the ch…
mesh/delivery delivered
The controller's check spent 3-5 minutes in cmd/mesh-controller, whose few hundred store tests run one after another, while most packages end in seconds. merge-check.sh now compiles each slow package once and deals its tests round-robin into processes that run beside each other and beside the rest of the suite; every test still runs once, under the race detector, through its package's TestMain. The listed store tests run beside the suite instead of after it. internal/builder's judge tests ran a real go build with a fresh Go cache each, compiling the standard library every time: half the suite's CPU. The fake runtime fills an empty cache from one warmed per process. The lease tests run in parallel. The link test of slow work now sets its one-second window after the serving loop asserted the controller's thirty-second one, so it proves the heartbeat (it passed without it) in half the time.
This commit is contained in:
@@ -22,6 +22,9 @@ import (
|
||||
// refused is a loss at once; and a bucket raised again from nothing never issues an epoch twice.
|
||||
//
|
||||
// go test ./internal/lease/ (each test on a bus of its own: internal/testbus)
|
||||
//
|
||||
// Each test runs beside the others (novox/hq issue 717): they share nothing but the clock, and wait on it
|
||||
// most of their time, so one after another they took half a minute of a check.
|
||||
|
||||
// The bounds in these tests are the design's divided by five, so the cases run in seconds.
|
||||
const (
|
||||
@@ -95,6 +98,7 @@ func takeWithin(t *testing.T, l *Lease) <-chan uint64 {
|
||||
}
|
||||
|
||||
func TestTheSecondControllerWaitsAndTakesAHigherEpochOnHandover(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, bucket := aBucket(t)
|
||||
a, b := aController(t, bucket, "a", nil), aController(t, bucket, "b", nil)
|
||||
|
||||
@@ -148,6 +152,7 @@ func TestTheSecondControllerWaitsAndTakesAHigherEpochOnHandover(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAHolderThatStopsRenewingStopsActingBeforeItIsTakenOver(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, bucket := aBucket(t)
|
||||
a, b := aController(t, bucket, "a", nil), aController(t, bucket, "b", nil)
|
||||
epochA, err := a.Take(t.Context())
|
||||
@@ -193,6 +198,7 @@ func TestAHolderThatStopsRenewingStopsActingBeforeItIsTakenOver(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestARenewalRefusedIsALossAtOnce(t *testing.T) {
|
||||
t.Parallel()
|
||||
js, bucket := aBucket(t)
|
||||
a := aController(t, bucket, "a", nil)
|
||||
if _, err := a.Take(t.Context()); err != nil {
|
||||
@@ -226,6 +232,7 @@ func TestARenewalRefusedIsALossAtOnce(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestKeepingRenewsAcrossManyAges(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, bucket := aBucket(t)
|
||||
a := aController(t, bucket, "a", nil)
|
||||
epoch, err := a.Take(t.Context())
|
||||
@@ -249,6 +256,7 @@ func TestKeepingRenewsAcrossManyAges(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAnEpochIsNeverIssuedTwiceWhenTheBucketStartsOver(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, bucket := aBucket(t)
|
||||
// The mesh has issued epoch 500 before: its store says so. The bucket is new — a bus whose data
|
||||
// was replaced — and its revisions start at one.
|
||||
@@ -275,6 +283,7 @@ func TestAnEpochIsNeverIssuedTwiceWhenTheBucketStartsOver(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestALeaseBucketWithoutAnAgeIsRefused(t *testing.T) {
|
||||
t.Parallel()
|
||||
url := testbus.URL(t)
|
||||
conn, err := nats.Connect(url)
|
||||
if err != nil {
|
||||
@@ -339,6 +348,7 @@ func delays(l *Lease) <-chan error {
|
||||
}
|
||||
|
||||
func TestAFailedRenewalKeepsTheLeaseUntilItsTTL(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, bucket := aBucket(t)
|
||||
a := aController(t, bucket, "a", nil)
|
||||
told := delays(a)
|
||||
@@ -390,6 +400,7 @@ func TestAFailedRenewalKeepsTheLeaseUntilItsTTL(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestARenewalMadeAfterAStallOpensTheGateAgain(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, bucket := aBucket(t)
|
||||
a := aController(t, bucket, "a", nil)
|
||||
bus := stallable(a, false)
|
||||
@@ -426,6 +437,7 @@ func TestARenewalMadeAfterAStallOpensTheGateAgain(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestARenewalWrittenThoughItsAnswerWasLostIsStillTheHolders(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, bucket := aBucket(t)
|
||||
a := aController(t, bucket, "a", nil)
|
||||
bus := stallable(a, true)
|
||||
@@ -460,6 +472,7 @@ func TestARenewalWrittenThoughItsAnswerWasLostIsStillTheHolders(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAnotherHolderSeenAfterAStallIsALossAtOnce(t *testing.T) {
|
||||
t.Parallel()
|
||||
js, bucket := aBucket(t)
|
||||
a := aController(t, bucket, "a", nil)
|
||||
bus := stallable(a, false)
|
||||
|
||||
Reference in New Issue
Block a user