Добавить X-Instance-Id, задержку drain при SIGTERM и отдельный запуск миграций
This commit is contained in:
@@ -50,6 +50,9 @@ func TestMain(m *testing.M) {
|
||||
|
||||
const testPassword = "correct-horse-battery"
|
||||
|
||||
// testInstance is the alias of the in-process application under test.
|
||||
const testInstance = "00000000000000a1"
|
||||
|
||||
// errorBody mirrors the contract error envelope.
|
||||
type errorBody struct {
|
||||
Error struct {
|
||||
@@ -103,6 +106,7 @@ func newTesterWithTTL(t *testing.T, ttl time.Duration) *tester {
|
||||
Sessions: kv.Client,
|
||||
SessionTTL: ttl,
|
||||
MaxBodyBytes: 64 * 1024,
|
||||
InstanceID: testInstance,
|
||||
})}
|
||||
}
|
||||
|
||||
@@ -135,6 +139,9 @@ func (ts *tester) do(method, path, token string, body any, headers map[string]st
|
||||
if res.requestID == "" {
|
||||
ts.t.Fatalf("%s %s: missing X-Request-Id", method, path)
|
||||
}
|
||||
if got := rec.Header().Get("X-Instance-Id"); got != testInstance {
|
||||
ts.t.Fatalf("%s %s: X-Instance-Id = %q, want %q", method, path, got, testInstance)
|
||||
}
|
||||
if res.status >= 400 {
|
||||
var eb errorBody
|
||||
if err := json.Unmarshal(res.raw, &eb); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user