=== RUN   TestDuplicatePlaylist_Success
2025/12/07 11:30:11 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: 8c68394057c1467fc2fb32af6452bead9cb6659b652d64c75919e78f3ad1a1f8
  Test ProcessID: f8df6288-075c-4cc6-be02-191a11af3894
2025/12/07 11:30:11 🐳 Creating container for image testcontainers/ryuk:0.8.1
2025/12/07 11:30:11 ✅ Container created: 8faf2d2b3127
2025/12/07 11:30:11 🐳 Starting container: 8faf2d2b3127
2025/12/07 11:30:11 ✅ Container started: 8faf2d2b3127
2025/12/07 11:30:11 ⏳ Waiting for container id 8faf2d2b3127 image: testcontainers/ryuk:0.8.1. Waiting for: &{Port:8080/tcp timeout:<nil> PollInterval:100ms skipInternalCheck:false}
2025/12/07 11:30:11 🔔 Container is ready: 8faf2d2b3127
2025/12/07 11:30:12 🐳 Creating container for image postgres:15-alpine
2025/12/07 11:30:20 ✅ Container created: 43cd6501f073
2025/12/07 11:31:17 🐳 Starting container: 43cd6501f073
2025/12/07 11:31:17 ✅ Container started: 43cd6501f073
2025/12/07 11:31:17 ⏳ Waiting for container id 43cd6501f073 image: postgres:15-alpine. Waiting for: &{timeout:<nil> deadline:0xc000472ac8 Strategies:[0xc0004beae0]}
2025/12/07 11:31:20 🔔 Container is ready: 43cd6501f073

2025/12/07 11:31:21 [31;1m/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:77 [35;1mERROR: null value in column "creator_id" of relation "tracks" violates not-null constraint (SQLSTATE 23502)
[0m[33m[2.129ms] [34;1m[rows:0][0m INSERT INTO "tracks" ("id","user_id","title","artist","album","duration","genre","year","file_path","file_size","format","bitrate","sample_rate","waveform_path","cover_art_path","is_public","status","status_message","stream_status","stream_manifest_url","play_count","like_count","created_at","updated_at","deleted_at") VALUES ('4ecace3b-a6a4-47fb-b068-bc616e5e22d2','e177aec3-0929-4775-8d65-8b6ba8b326ab','Test Track 190c13e1','Test Artist','',180,'',0,'/test/track.mp3',5242880,'mp3',0,0,'','',true,'completed','','pending','',0,0,'2025-12-07 11:31:21.743','2025-12-07 11:31:21.743',NULL)
    playlist_duplicate_transaction_test.go:78: 
        	Error Trace:	/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:78
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:96
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:133
        	Error:      	Received unexpected error:
        	            	ERROR: null value in column "creator_id" of relation "tracks" violates not-null constraint (SQLSTATE 23502)
        	Test:       	TestDuplicatePlaylist_Success
--- FAIL: TestDuplicatePlaylist_Success (70.70s)
=== RUN   TestDuplicatePlaylist_RollbackOnPlaylistNotFound

2025/12/07 11:31:22 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/playlist_duplicate_service.go:56 [35;1mrecord not found
[0m[33m[3.269ms] [34;1m[rows:0][0m SELECT * FROM "playlists" WHERE id = '350267f3-1aaa-4d70-8d5a-4456617a4968' AND "playlists"."deleted_at" IS NULL ORDER BY "playlists"."id" LIMIT 1
--- PASS: TestDuplicatePlaylist_RollbackOnPlaylistNotFound (0.70s)
=== RUN   TestDuplicatePlaylist_RollbackOnTrackError

2025/12/07 11:31:23 [31;1m/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:77 [35;1mERROR: null value in column "creator_id" of relation "tracks" violates not-null constraint (SQLSTATE 23502)
[0m[33m[1.959ms] [34;1m[rows:0][0m INSERT INTO "tracks" ("id","user_id","title","artist","album","duration","genre","year","file_path","file_size","format","bitrate","sample_rate","waveform_path","cover_art_path","is_public","status","status_message","stream_status","stream_manifest_url","play_count","like_count","created_at","updated_at","deleted_at") VALUES ('be5be0d0-a5bb-4487-8032-2537c2d79652','687802c7-e4da-47d6-89e8-2540a9ac2f30','Test Track d1e1a15a','Test Artist','',180,'',0,'/test/track.mp3',5242880,'mp3',0,0,'','',true,'completed','','pending','',0,0,'2025-12-07 11:31:23.183','2025-12-07 11:31:23.183',NULL)
    playlist_duplicate_transaction_test.go:78: 
        	Error Trace:	/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:78
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:96
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:216
        	Error:      	Received unexpected error:
        	            	ERROR: null value in column "creator_id" of relation "tracks" violates not-null constraint (SQLSTATE 23502)
        	Test:       	TestDuplicatePlaylist_RollbackOnTrackError
--- FAIL: TestDuplicatePlaylist_RollbackOnTrackError (0.78s)
=== RUN   TestDuplicatePlaylist_Coherence

2025/12/07 11:31:23 [31;1m/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:77 [35;1mERROR: null value in column "creator_id" of relation "tracks" violates not-null constraint (SQLSTATE 23502)
[0m[33m[2.075ms] [34;1m[rows:0][0m INSERT INTO "tracks" ("id","user_id","title","artist","album","duration","genre","year","file_path","file_size","format","bitrate","sample_rate","waveform_path","cover_art_path","is_public","status","status_message","stream_status","stream_manifest_url","play_count","like_count","created_at","updated_at","deleted_at") VALUES ('a96d65f5-26ff-4ed7-baf0-d5b384ab6a8f','d6b772c3-8a79-4925-99a7-87e8c893c615','Test Track c5386da3','Test Artist','',180,'',0,'/test/track.mp3',5242880,'mp3',0,0,'','',true,'completed','','pending','',0,0,'2025-12-07 11:31:23.945','2025-12-07 11:31:23.945',NULL)
    playlist_duplicate_transaction_test.go:78: 
        	Error Trace:	/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:78
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:96
        	            				/home/senke/Documents/veza/veza-backend-api/tests/transactions/playlist_duplicate_transaction_test.go:274
        	Error:      	Received unexpected error:
        	            	ERROR: null value in column "creator_id" of relation "tracks" violates not-null constraint (SQLSTATE 23502)
        	Test:       	TestDuplicatePlaylist_Coherence
--- FAIL: TestDuplicatePlaylist_Coherence (0.73s)
=== RUN   TestDuplicatePlaylist_EmptyPlaylist
    logger.go:146: 2025-12-07T11:31:24.587+0100	INFO	Playlist duplicated	{"original_playlist_id": "007f7d20-9b5a-40dd-8877-317274fc91d0", "new_playlist_id": "de55d86a-8085-4339-916b-dd57b06c39a0", "user_id": "9ea3b416-dcd2-43bf-a1e3-7be69f2fe3ba", "tracks_count": 0}
--- PASS: TestDuplicatePlaylist_EmptyPlaylist (0.67s)
=== RUN   TestAssignRoleToUser_Success

2025/12/07 11:31:25 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[1.099ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = '286329b6-cea1-4e6c-ad13-3d5c86d2887e' AND role_id = 'daed17d2-9310-441f-b311-ab76825dc788' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:31:25.142+0100	INFO	Role assigned to user successfully	{"user_id": "286329b6-cea1-4e6c-ad13-3d5c86d2887e", "role_id": "daed17d2-9310-441f-b311-ab76825dc788"}
--- PASS: TestAssignRoleToUser_Success (0.48s)
=== RUN   TestAssignRoleToUser_RollbackOnUserNotFound

2025/12/07 11:31:25 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:175 [35;1mrecord not found
[0m[33m[2.587ms] [34;1m[rows:0][0m SELECT * FROM "users" WHERE "users"."id" = 'e49ca2fd-d271-4072-83d9-8e870d009b68' AND "users"."deleted_at" IS NULL ORDER BY "users"."id" LIMIT 1 FOR UPDATE
--- PASS: TestAssignRoleToUser_RollbackOnUserNotFound (0.57s)
=== RUN   TestAssignRoleToUser_RollbackOnRoleNotFound

2025/12/07 11:31:26 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:184 [35;1mrecord not found
[0m[33m[0.848ms] [34;1m[rows:0][0m SELECT * FROM "roles" WHERE "roles"."id" = '17b8e393-c08a-4052-aa41-7b521f45c976' ORDER BY "roles"."id" LIMIT 1 FOR UPDATE
--- PASS: TestAssignRoleToUser_RollbackOnRoleNotFound (0.55s)
=== RUN   TestAssignRoleToUser_RollbackOnDuplicate

2025/12/07 11:31:26 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[1.115ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = '56795c69-c419-4bce-9aef-931d12831837' AND role_id = 'eb01e9f7-2dda-413b-8ffd-d13e39698b82' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:31:26.786+0100	INFO	Role assigned to user successfully	{"user_id": "56795c69-c419-4bce-9aef-931d12831837", "role_id": "eb01e9f7-2dda-413b-8ffd-d13e39698b82"}
--- PASS: TestAssignRoleToUser_RollbackOnDuplicate (0.54s)
=== RUN   TestAssignRoleToUser_Concurrency

2025/12/07 11:31:27 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[1.494ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = '20eb82f8-8bb3-41e2-8f57-828416582f89' AND role_id = '6c5b47e4-5eb9-4488-b038-d30314db56d5' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:31:27.251+0100	INFO	Role assigned to user successfully	{"user_id": "20eb82f8-8bb3-41e2-8f57-828416582f89", "role_id": "6c5b47e4-5eb9-4488-b038-d30314db56d5"}
--- PASS: TestAssignRoleToUser_Concurrency (0.55s)
=== RUN   TestAssignRoleToUser_Atomicity

2025/12/07 11:31:27 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:195 [35;1mrecord not found
[0m[33m[1.042ms] [34;1m[rows:0][0m SELECT * FROM "user_roles" WHERE user_id = '91cd7219-8f53-42da-abc4-776c7a18efc1' AND role_id = '55099116-23d2-4ec5-b8eb-1613427e5afb' ORDER BY "user_roles"."id" LIMIT 1 FOR UPDATE
    logger.go:146: 2025-12-07T11:31:27.807+0100	INFO	Role assigned to user successfully	{"user_id": "91cd7219-8f53-42da-abc4-776c7a18efc1", "role_id": "55099116-23d2-4ec5-b8eb-1613427e5afb"}

2025/12/07 11:31:27 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/services/rbac_service.go:184 [35;1mrecord not found
[0m[33m[0.507ms] [34;1m[rows:0][0m SELECT * FROM "roles" WHERE "roles"."id" = '55099116-23d2-4ec5-b8eb-1613427e5afb' ORDER BY "roles"."id" LIMIT 1 FOR UPDATE
--- PASS: TestAssignRoleToUser_Atomicity (0.46s)
=== RUN   TestToggleLike_Success

2025/12/07 11:31:28 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[2.536ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = '1e9dba3c-f81d-4040-9065-41bef67f936e' AND target_id = '7e1fb130-e691-40e6-8e20-ed8befc520d1' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1
--- PASS: TestToggleLike_Success (0.43s)
=== RUN   TestToggleLike_Unlike

2025/12/07 11:31:28 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[3.499ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = '52758765-6e8e-42f4-af91-bc18ecdb0512' AND target_id = 'e0268d9e-1778-43d7-9907-92ebe1be1988' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1
--- PASS: TestToggleLike_Unlike (0.44s)
=== RUN   TestToggleLike_RollbackOnError

2025/12/07 11:31:29 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[2.152ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = 'e26a6fbc-0b63-4ace-b6ed-5d1504e3a646' AND target_id = '7280d602-652b-4598-94b9-41fd4e6e30e6' 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.35s)
=== RUN   TestToggleLike_Coherence

2025/12/07 11:31:29 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[2.407ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = 'fb39b1dc-c374-4485-9c97-31fa6a1bb6de' AND target_id = '97be76e5-2fd9-4994-83fc-7aba9799706b' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1

2025/12/07 11:31:29 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:138 [35;1mrecord not found
[0m[33m[0.383ms] [34;1m[rows:0][0m SELECT * FROM "likes" WHERE user_id = '0237794d-b639-47a3-8b26-aa86db8246f0' AND target_id = '97be76e5-2fd9-4994-83fc-7aba9799706b' AND target_type = 'post' ORDER BY "likes"."id" LIMIT 1
--- PASS: TestToggleLike_Coherence (0.35s)
=== RUN   TestAddComment_Success
--- PASS: TestAddComment_Success (0.34s)
=== RUN   TestAddComment_RollbackOnError

2025/12/07 11:31:30 [31;1m/home/senke/Documents/veza/veza-backend-api/internal/core/social/service.go:196 [35;1mrecord not found
[0m[33m[3.097ms] [34;1m[rows:0][0m SELECT * FROM "posts" WHERE id = '0f02231a-f072-4dc1-8bbe-967cbe7be24e' AND "posts"."deleted_at" IS NULL ORDER BY "posts"."id" LIMIT 1
--- PASS: TestAddComment_RollbackOnError (0.34s)
=== RUN   TestAddComment_Coherence
--- PASS: TestAddComment_Coherence (0.36s)
FAIL
FAIL	veza-backend-api/tests/transactions	79.491s
FAIL
