forked from mtusi2026/mtusi2026lab2
ЛР 2: завершить трек 2 на оценку 5
This commit is contained in:
@@ -416,8 +416,6 @@ func TestRedisPublicHTTPContractIsUnchanged(t *testing.T) {
|
||||
root := filepath.Clean(filepath.Join(filepath.Dir(source), "..", ".."))
|
||||
// The full acceptance suite performs many Argon2id operations. Under -race
|
||||
// it needs its own budget rather than the 45-second SQL fixture budget.
|
||||
acceptanceCtx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
|
||||
defer cancel()
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
args []string
|
||||
@@ -426,10 +424,24 @@ func TestRedisPublicHTTPContractIsUnchanged(t *testing.T) {
|
||||
{"auth_normal", []string{filepath.Join(root, "student-tests/auth_contract.py"), "--base-url", server.URL, "--ttl", "3600"}},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
// Each independent subprocess gets the full acceptance budget. A smoke
|
||||
// run must not consume part of the following auth suite's allowance.
|
||||
acceptanceCtx, cancel := context.WithTimeout(context.Background(), 300*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(acceptanceCtx, "python3", tc.args...)
|
||||
cmd.Dir = root
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
for _, line := range strings.Split(string(output), "\n") {
|
||||
if strings.HasPrefix(line, "test_") {
|
||||
// Only method names: never print credentials or subtest values.
|
||||
name, _, _ := strings.Cut(line, " ")
|
||||
t.Log("acceptance progress: " + name)
|
||||
}
|
||||
}
|
||||
if acceptanceCtx.Err() != nil {
|
||||
t.Fatal("HTTP acceptance subprocess exceeded its own execution budget; application operation budgets are unchanged")
|
||||
}
|
||||
// Public clients keep tokens in memory. Show only status diagnostics.
|
||||
for _, line := range strings.Split(string(output), "\n") {
|
||||
if strings.Contains(line, "expected [") && strings.Contains(line, "received") {
|
||||
|
||||
Reference in New Issue
Block a user