=== RUN   TestDuplicatePlaylist_Success
2025/12/07 11:34:53 github.com/testcontainers/testcontainers-go - Connected to docker: 
  Server Version: 28.1.1
  API Version: 1.46
  Operating System: Fedora Linux 40 (Workstation Edition)
  Total Memory: 15703 MB
  Testcontainers for Go Version: v0.33.0
  Resolved Docker Host: unix:///var/run/docker.sock
  Resolved Docker Socket Path: /var/run/docker.sock
  Test SessionID: 440455632d156d5c5609fefcdcaa3a78afcb9784d6e1c787217dc097ea00a9d7
  Test ProcessID: 06385116-2960-43ac-8823-797560026a86
2025/12/07 11:34:53 🐳 Creating container for image testcontainers/ryuk:0.8.1
2025/12/07 11:34:57 ✅ Container created: 0ade6b707bb2
2025/12/07 11:34:57 🐳 Starting container: 0ade6b707bb2
2025/12/07 11:34:57 ✅ Container started: 0ade6b707bb2
2025/12/07 11:34:57 ⏳ Waiting for container id 0ade6b707bb2 image: testcontainers/ryuk:0.8.1. Waiting for: &{Port:8080/tcp timeout:<nil> PollInterval:100ms skipInternalCheck:false}
2025/12/07 11:34:57 🔔 Container is ready: 0ade6b707bb2
2025/12/07 11:34:57 🐳 Creating container for image postgres:15-alpine
2025/12/07 11:35:07 ✅ Container created: 869055a3a8ce
2025/12/07 11:36:04 🐳 Starting container: 869055a3a8ce
2025/12/07 11:36:04 ✅ Container started: 869055a3a8ce
2025/12/07 11:36:04 ⏳ Waiting for container id 869055a3a8ce image: postgres:15-alpine. Waiting for: &{timeout:<nil> deadline:0xc000298ef8 Strategies:[0xc0000d8660]}
2025/12/07 11:36:07 🔔 Container is ready: 869055a3a8ce

2025/12/07 11:36:08 [31;1m/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:118 [35;1mERROR: null value in column "added_by" of relation "playlist_tracks" violates not-null constraint (SQLSTATE 23502)
[0m[33m[1.836ms] [34;1m[rows:0][0m INSERT INTO "playlist_tracks" ("id","playlist_id","track_id","position","added_at") VALUES ('2cff9932-44c5-4900-aab5-a4ea87c6fd61','e6d84276-2f15-41f9-8614-1d334d2aec94','b424fbfa-32c2-4f1e-b3a6-497a94250b10',1,'2025-12-07 11:36:08.484')
    playlist_duplicate_transaction_test.go:119: 
        	Error Trace:	/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:119
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:145
        	Error:      	Received unexpected error:
        	            	ERROR: null value in column "added_by" of relation "playlist_tracks" violates not-null constraint (SQLSTATE 23502)
        	Test:       	TestDuplicatePlaylist_Success
--- FAIL: TestDuplicatePlaylist_Success (75.15s)
=== RUN   TestDuplicatePlaylist_RollbackOnPlaylistNotFound

2025/12/07 11:36:09 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/playlist_duplicate_service.go:56 [35;1mrecord not found
[0m[33m[2.535ms] [34;1m[rows:0][0m SELECT * FROM "playlists" WHERE id = 'afd1be0a-d339-4db9-9fae-d81a49865aed' AND "playlists"."deleted_at" IS NULL ORDER BY "playlists"."id" LIMIT 1
--- PASS: TestDuplicatePlaylist_RollbackOnPlaylistNotFound (0.70s)
=== RUN   TestDuplicatePlaylist_RollbackOnTrackError

2025/12/07 11:36:09 [31;1m/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:118 [35;1mERROR: null value in column "added_by" of relation "playlist_tracks" violates not-null constraint (SQLSTATE 23502)
[0m[33m[1.553ms] [34;1m[rows:0][0m INSERT INTO "playlist_tracks" ("id","playlist_id","track_id","position","added_at") VALUES ('b5eb9580-ba0d-4212-917d-8f582a25c712','bd91519a-8673-4aff-acc4-291fb923a99c','8642b93b-0c50-4e8e-b9bd-523ac8fa211b',1,'2025-12-07 11:36:09.896')
    playlist_duplicate_transaction_test.go:119: 
        	Error Trace:	/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:119
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:228
        	Error:      	Received unexpected error:
        	            	ERROR: null value in column "added_by" of relation "playlist_tracks" violates not-null constraint (SQLSTATE 23502)
        	Test:       	TestDuplicatePlaylist_RollbackOnTrackError
--- FAIL: TestDuplicatePlaylist_RollbackOnTrackError (0.69s)
=== RUN   TestDuplicatePlaylist_Coherence

2025/12/07 11:36:10 [31;1m/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:118 [35;1mERROR: null value in column "added_by" of relation "playlist_tracks" violates not-null constraint (SQLSTATE 23502)
[0m[33m[1.177ms] [34;1m[rows:0][0m INSERT INTO "playlist_tracks" ("id","playlist_id","track_id","position","added_at") VALUES ('4c871380-93a8-4a01-a99c-3f25bb299196','0f12c303-292a-4eab-ac01-4028b38a65f8','e09027d2-abc7-4404-be3d-702a63345e33',1,'2025-12-07 11:36:10.58')
    playlist_duplicate_transaction_test.go:119: 
        	Error Trace:	/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:119
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:286
        	Error:      	Received unexpected error:
        	            	ERROR: null value in column "added_by" of relation "playlist_tracks" violates not-null constraint (SQLSTATE 23502)
        	Test:       	TestDuplicatePlaylist_Coherence
--- FAIL: TestDuplicatePlaylist_Coherence (0.69s)
=== RUN   TestDuplicatePlaylist_EmptyPlaylist
    logger.go:146: 2025-12-07T11:36:11.226+0100	INFO	Playlist duplicated	{"original_playlist_id": "7aa8d92e-302f-46e8-ab0b-27bf1b15ccfb", "new_playlist_id": "dd92e703-94ce-4d1e-bd4e-6a12e27b162e", "user_id": "f9bf075d-135a-4a63-9972-5e4f771f1a48", "tracks_count": 0}
--- PASS: TestDuplicatePlaylist_EmptyPlaylist (0.64s)
=== RUN   TestAssignRoleToUser_Success

2025/12/07 11:36:11 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[2.105ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = 'a854f544-e78b-460f-b066-52c73065f1da' AND role_id = '2bb31f3e-40dd-4cd6-9322-a8b1fb2259dd' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:36:11.888+0100	INFO	Role assigned to user successfully	{"user_id": "a854f544-e78b-460f-b066-52c73065f1da", "role_id": "2bb31f3e-40dd-4cd6-9322-a8b1fb2259dd"}
--- PASS: TestAssignRoleToUser_Success (0.67s)
=== RUN   TestAssignRoleToUser_RollbackOnUserNotFound

2025/12/07 11:36:12 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:175 [35;1mrecord not found
[0m[33m[3.126ms] [34;1m[rows:0][0m SELECT * FROM "users" WHERE "users"."id" = '0a7c250c-f6dd-43cc-926b-506002381493' AND "users"."deleted_at" IS NULL ORDER BY "users"."id" LIMIT 1 FOR UPDATE
--- PASS: TestAssignRoleToUser_RollbackOnUserNotFound (0.62s)
=== RUN   TestAssignRoleToUser_RollbackOnRoleNotFound

2025/12/07 11:36:13 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:184 [35;1mrecord not found
[0m[33m[1.145ms] [34;1m[rows:0][0m SELECT * FROM "roles" WHERE "roles"."id" = '6085c22c-9c49-4014-8a61-179ef3a6efd3' ORDER BY "roles"."id" LIMIT 1 FOR UPDATE
--- PASS: TestAssignRoleToUser_RollbackOnRoleNotFound (0.50s)
=== RUN   TestAssignRoleToUser_RollbackOnDuplicate

2025/12/07 11:36:13 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[1.160ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = '2635bffb-4865-46e0-9600-f41232b7e44b' AND role_id = 'a10d1733-8565-4ddf-aaeb-d1f0deeb7a2b' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:36:13.551+0100	INFO	Role assigned to user successfully	{"user_id": "2635bffb-4865-46e0-9600-f41232b7e44b", "role_id": "a10d1733-8565-4ddf-aaeb-d1f0deeb7a2b"}
--- PASS: TestAssignRoleToUser_RollbackOnDuplicate (0.50s)
=== RUN   TestAssignRoleToUser_Concurrency

2025/12/07 11:36:14 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[2.201ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = 'a392cbe1-71f5-4090-8ffa-8fb3737bb4c3' AND role_id = 'c3f0a9cc-ee1e-413e-b1c0-0468ffe23a3f' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:36:14.034+0100	INFO	Role assigned to user successfully	{"user_id": "a392cbe1-71f5-4090-8ffa-8fb3737bb4c3", "role_id": "c3f0a9cc-ee1e-413e-b1c0-0468ffe23a3f"}
--- PASS: TestAssignRoleToUser_Concurrency (0.54s)
=== RUN   TestAssignRoleToUser_Atomicity

2025/12/07 11:36:14 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[0.923ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = 'ba31ed52-568c-444b-b672-a6da2f0dc4f4' AND role_id = '0ea533dd-3855-45ba-aca7-5961785427b9' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:36:14.595+0100	INFO	Role assigned to user successfully	{"user_id": "ba31ed52-568c-444b-b672-a6da2f0dc4f4", "role_id": "0ea533dd-3855-45ba-aca7-5961785427b9"}

2025/12/07 11:36:14 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:184 [35;1mrecord not found
[0m[33m[0.464ms] [34;1m[rows:0][0m SELECT * FROM "roles" WHERE "roles"."id" = '0ea533dd-3855-45ba-aca7-5961785427b9' ORDER BY "roles"."id" LIMIT 1 FOR UPDATE
--- PASS: TestAssignRoleToUser_Atomicity (0.51s)
=== RUN   TestToggleLike_Success

2025/12/07 11:36:14 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[3.074ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = 'c32b6eaa-6436-44d2-878d-c8e7212201b4' AND target_id = 'd6a40c6a-c42a-452f-a836-048659c55d0f' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1
--- PASS: TestToggleLike_Success (0.38s)
=== RUN   TestToggleLike_Unlike

2025/12/07 11:36:15 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[2.317ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = 'bbeef6e1-e98b-4271-939c-00de7975351e' AND target_id = '084595c7-e8e2-4a40-a8cd-12e8c4918347' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1
--- PASS: TestToggleLike_Unlike (0.38s)
=== RUN   TestToggleLike_RollbackOnError

2025/12/07 11:36:15 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[1.801ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = 'd43390da-c008-4190-a7e6-3c554112f575' AND target_id = '86ae2b81-d401-431e-8fc0-47b7c34dd285' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1
    social_transaction_test.go:190: 
        	Error Trace:	/home/senke/Documents/veza/veza-backend-api/tests/transactions/social_transaction_test.go:190
        	Error:      	An error is expected but got nil.
        	Test:       	TestToggleLike_RollbackOnError
        	Messages:   	ToggleLike should fail
--- FAIL: TestToggleLike_RollbackOnError (0.38s)
=== RUN   TestToggleLike_Coherence

2025/12/07 11:36:16 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[2.121ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = '38be238a-d1a6-42f3-936d-f025fbc78a4d' AND target_id = '33179c3f-9f3e-4917-8c9b-3564db8a3a48' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1

2025/12/07 11:36:16 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[0.542ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = '3b588716-a306-4ad8-bf4a-8c9ff3a63844' AND target_id = '33179c3f-9f3e-4917-8c9b-3564db8a3a48' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1
--- PASS: TestToggleLike_Coherence (0.38s)
=== RUN   TestAddComment_Success
--- PASS: TestAddComment_Success (0.48s)
=== RUN   TestAddComment_RollbackOnError

2025/12/07 11:36:17 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:196 [35;1mrecord not found
[0m[33m[2.774ms] [34;1m[rows:0][0m SELECT * FROM "posts" WHERE id = 'd5a323c7-9fcc-493d-8bdd-392e1c10d7e3' AND "posts"."deleted_at" IS NULL ORDER BY "posts"."id" LIMIT 1
--- PASS: TestAddComment_RollbackOnError (0.57s)
=== RUN   TestAddComment_Coherence
--- PASS: TestAddComment_Coherence (0.50s)
FAIL
FAIL	veza-backend-api/tests/transactions	84.372s
FAIL
