fixed read-after-write after failed cache invalidation and API restart

This commit is contained in:
Нурлыгаянова Екатерина
2026-10-29 15:18:44 +03:00
parent 5021df4ea8
commit ee87d17cb9
13 changed files with 510 additions and 78 deletions
+15 -7
View File
@@ -3,19 +3,21 @@
--- PASS: TestUsernameRace (0.02s)
=== RUN TestCreateChatRollback
integration_test.go:116: неизвестный участник → 400, chats/chat_members без изменений; валидный вызов создаёт 1 чат
--- PASS: TestCreateChatRollback (0.01s)
--- PASS: TestCreateChatRollback (0.02s)
=== RUN TestMessageRequiresMembership
--- PASS: TestMessageRequiresMembership (0.01s)
=== RUN TestNULRoundTrip
--- PASS: TestNULRoundTrip (0.07s)
--- PASS: TestNULRoundTrip (0.08s)
=== RUN TestPendingInvalidationCAS
--- PASS: TestPendingInvalidationCAS (0.01s)
PASS
ok gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/store/db 0.861s
ok gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/store/db 0.316s
=== RUN TestReadAfterWrite_FillRace
=== RUN TestReadAfterWrite_FillRace/naive
history_test.go:141: naive: чтение после подтверждённой записи stale=true
=== RUN TestReadAfterWrite_FillRace/safe
history_test.go:141: safe: чтение после подтверждённой записи stale=false
--- PASS: TestReadAfterWrite_FillRace (0.33s)
--- PASS: TestReadAfterWrite_FillRace (0.32s)
--- PASS: TestReadAfterWrite_FillRace/naive (0.11s)
--- PASS: TestReadAfterWrite_FillRace/safe (0.22s)
=== RUN TestStampede_SQLCount
@@ -23,8 +25,8 @@ ok gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/store/db 0
history_test.go:184: naive: 50 одновременных промахов → 50 запросов страницы в БД
=== RUN TestStampede_SQLCount/safe
history_test.go:184: safe: 50 одновременных промахов → 1 запросов страницы в БД
--- PASS: TestStampede_SQLCount (0.13s)
--- PASS: TestStampede_SQLCount/naive (0.07s)
--- PASS: TestStampede_SQLCount (0.14s)
--- PASS: TestStampede_SQLCount/naive (0.08s)
--- PASS: TestStampede_SQLCount/safe (0.06s)
=== RUN TestAccessCheckedBeforeCache
--- PASS: TestAccessCheckedBeforeCache (0.01s)
@@ -32,5 +34,11 @@ ok gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/store/db 0
--- PASS: TestCacheLossIsOnlyMiss (0.01s)
=== RUN TestCacheDown_Bypass
--- PASS: TestCacheDown_Bypass (0.00s)
=== RUN TestReadAfterWrite_InvalidationFailedThenRestart
--- PASS: TestReadAfterWrite_InvalidationFailedThenRestart (0.03s)
=== RUN TestBypassUntilOutboxLoaded
--- PASS: TestBypassUntilOutboxLoaded (0.81s)
=== RUN TestRetryDoesNotDropNewerFailure
--- PASS: TestRetryDoesNotDropNewerFailure (0.00s)
PASS
ok gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/cache 1.621s
ok gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/cache 1.637s