CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

Plugin auth throw Unhandled Rejection at: Promise - Chaining cycle detected for promise

Open mkbam opened this issue 3 months ago • 0 comments

If a test case have a separate session function inside a Scenario and Data is passed multiple time then Plugin auth is throwing an error message of 'Chaining cycle detected for promise' when used with process.on('unhandledRejection', (reason, promise) => { console.error('Unhandled Rejection at:', promise, 'reason:', reason);});

It's trying to call [1] Retrying... Attempt #2 which is calling login and getting in infinite loop.

Sample Code:

`Data([ 'a', 'b', ]).Scenario('issue', async({ current })=>{ login('userA'); I.click('sometext'); await session('sessionB', async ()=>{ login('userB'); // When test case run 2nd time with data 'b' // It get issue on login funciton // nhandled Rejection at: Promise { // [TypeError: Chaining cycle detected for promise #] //} reason: [TypeError: Chaining cycle detected for promise #] //booststrap - unhandledRejection: //[TypeError: Chaining cycle detected for promise #]

		//I am logged in as userB
		 //  userB: I am on page "/"
		 //  › [Url] https://lsite/login
		 //  › [Browser:Verbose] 
		 //[1] <check login> Retrying... Attempt #2			
		
		I.click('sometext');
		
	});

}).tag('@issue');`

some

mkbam avatar Sep 23 '25 19:09 mkbam