$ make test-storage
./scripts/test-storage.sh
=== RUN   TestIdempotencyTransactionAndExpiry
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/empty
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/whitespace
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/invalid_UTF8
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nul
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_long
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/duplicate
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_many
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nil_id
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/unknown
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/foreign_chat
=== RUN   TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/missing_object
=== RUN   TestIdempotencyTransactionAndExpiry/object_lock_cancellation_does_not_leak_a_pooled_lock
=== NAME  TestIdempotencyTransactionAndExpiry
    idempotency_test.go:295: rollback removed both side effect and key; expired key created one new message
--- PASS: TestIdempotencyTransactionAndExpiry (0.11s)
    --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules (0.02s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/empty (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/whitespace (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/invalid_UTF8 (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nul (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_long (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/duplicate (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_many (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nil_id (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/unknown (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/foreign_chat (0.00s)
        --- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/missing_object (0.00s)
    --- PASS: TestIdempotencyTransactionAndExpiry/object_lock_cancellation_does_not_leak_a_pooled_lock (0.05s)
PASS
2026/11/13 07:54:01 INFO connected to database db=lab4_atomic_1794556440_46549
2026/11/13 07:54:01 INFO successfully initialized migrator
2026/11/13 07:54:01 INFO successfully loaded migrations error=<nil>
2026/11/13 07:54:01 INFO postgres_pool_config max_conns=8 connect_timeout=500ms statement_timeout_ms=2000
2026/11/13 07:54:01 INFO successfully connected to postgres pool
2026/11/13 07:54:01 ERROR Query err="ERROR: synthetic failure (SQLSTATE P0001)" ts=187.375µs pid=244 sql="INSERT INTO message_idempotency(user_id,method,chat_id,key,request_hash,message_id,expires_at,hash_version)\n        VALUES($1,'POST',$2,$3,$4,$5,clock_timestamp()+interval '24 hours',2)\n        ON CONFLICT(user_id,method,chat_id,key) DO UPDATE SET request_hash=EXCLUDED.request_hash,\n        message_id=EXCLUDED.message_id,expires_at=EXCLUDED.expires_at,hash_version=EXCLUDED.hash_version" args="[a6a209a3-9450-4393-ab7a-0c2859360754 877fa02a-7912-436c-83d1-9f0bc9cc0552 failure-key da0166d9297a757bea3229f89135b665155b9cf24402c98ce373c6388e9d0e1e 8ec1c403-6820-4c60-a2df-3fcbc2095228]"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 ERROR Query err="ERROR: insert or update on table \"message_attachments\" violates foreign key constraint \"message_attachments_attachment_id_chat_id_fkey\" (SQLSTATE 23503)" ts=127.375µs pid=244 sql="INSERT INTO message_attachments(message_id,chat_id,attachment_id,position) VALUES($1,$2,$3,$4)" args="[4ee5dcc7-106c-4641-b38e-06d84880cf1e 877fa02a-7912-436c-83d1-9f0bc9cc0552 7bd482b6-cd37-4061-93c0-7859e2869d25 1]"
2026/11/13 07:54:01 ERROR Query sql="SELECT pg_advisory_lock(hashtextextended($1, 42))" args=[originals/bcaecf31-d3db-4b63-8eb3-6c93cea1c0b5] err="timeout: context deadline exceeded" ts=49.253584ms pid=245
