Resolve TestAkamaiPurgerDrainQueueFails race (#6844)
Fixes https://github.com/letsencrypt/boulder/issues/6837
This commit is contained in:
parent
97aa50977f
commit
25cae29f70
|
|
@ -77,13 +77,19 @@ func TestAkamaiPurgerDrainQueueFails(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, err = purgerClient.Purge(context.Background(), &akamaipb.PurgeRequest{
|
||||
Urls: []string{"http://example.com/"},
|
||||
})
|
||||
if err != nil {
|
||||
// Don't use t.Fatal here because we need to get as far as the SIGTERM or
|
||||
// we'll hang on exit.
|
||||
t.Error(err)
|
||||
|
||||
// We know that the purger is configured to only process two items per batch,
|
||||
// so submitting 10 items should give it enough of a backlog to guarantee
|
||||
// that our SIGTERM reaches the process before it's fully cleared the queue.
|
||||
for i := 0; i < 10; i++ {
|
||||
_, err = purgerClient.Purge(context.Background(), &akamaipb.PurgeRequest{
|
||||
Urls: []string{fmt.Sprintf("http://example%d.com/", i)},
|
||||
})
|
||||
if err != nil {
|
||||
// Don't use t.Fatal here because we need to get as far as the SIGTERM or
|
||||
// we'll hang on exit.
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
purgerCmd.Process.Signal(syscall.SIGTERM)
|
||||
|
|
@ -91,7 +97,11 @@ func TestAkamaiPurgerDrainQueueFails(t *testing.T) {
|
|||
if err == nil {
|
||||
t.Error("expected error shutting down akamai-purger that could not reach backend")
|
||||
}
|
||||
test.AssertContains(t, outputBuffer.String(), "failed to purge OCSP responses for 1 certificates before exit: all attempts to submit purge request failed")
|
||||
|
||||
// Use two asserts because we're not sure what integer (10? 8?) will come in
|
||||
// the middle of the error message.
|
||||
test.AssertContains(t, outputBuffer.String(), "failed to purge OCSP responses for")
|
||||
test.AssertContains(t, outputBuffer.String(), "certificates before exit: all attempts to submit purge request failed")
|
||||
}
|
||||
|
||||
func TestAkamaiPurgerDrainQueueSucceeds(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -1,29 +1,41 @@
|
|||
{
|
||||
"akamaiPurger": {
|
||||
"debugAddr": ":9766",
|
||||
"purgeRetries": 10,
|
||||
"purgeRetryBackoff": "50ms",
|
||||
"baseURL": "http://localhost:6889",
|
||||
"clientToken": "its-a-token",
|
||||
"clientSecret": "its-a-secret",
|
||||
"accessToken": "idk-how-this-is-different-from-client-token-but-okay",
|
||||
"v3Network": "staging",
|
||||
"tls": {
|
||||
"caCertfile": "test/grpc-creds/minica.pem",
|
||||
"certFile": "test/grpc-creds/akamai-purger.boulder/cert.pem",
|
||||
"keyFile": "test/grpc-creds/akamai-purger.boulder/key.pem"
|
||||
},
|
||||
"grpc": {
|
||||
"address": ":9199",
|
||||
"clientNames": [
|
||||
"health-checker.boulder",
|
||||
"ra.boulder"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"syslog": {
|
||||
"stdoutlevel": 6,
|
||||
"sysloglevel": 6
|
||||
}
|
||||
"akamaiPurger": {
|
||||
"debugAddr": ":9766",
|
||||
"purgeRetries": 10,
|
||||
"purgeRetryBackoff": "50ms",
|
||||
"throughput": {
|
||||
"queueEntriesPerBatch": 2,
|
||||
"purgeBatchInterval": "32ms"
|
||||
},
|
||||
"baseURL": "http://localhost:6889",
|
||||
"clientToken": "its-a-token",
|
||||
"clientSecret": "its-a-secret",
|
||||
"accessToken": "idk-how-this-is-different-from-client-token-but-okay",
|
||||
"v3Network": "staging",
|
||||
"tls": {
|
||||
"caCertfile": "test/grpc-creds/minica.pem",
|
||||
"certFile": "test/grpc-creds/akamai-purger.boulder/cert.pem",
|
||||
"keyFile": "test/grpc-creds/akamai-purger.boulder/key.pem"
|
||||
},
|
||||
"grpc": {
|
||||
"address": ":9199",
|
||||
"maxConnectionAge": "30s",
|
||||
"services": {
|
||||
"akamai.AkamaiPurger": {
|
||||
"clientNames": [
|
||||
"ra.boulder"
|
||||
]
|
||||
},
|
||||
"grpc.health.v1.Health": {
|
||||
"clientNames": [
|
||||
"health-checker.boulder"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"syslog": {
|
||||
"stdoutlevel": 6,
|
||||
"sysloglevel": -1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue