Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
HELP! FATAL ERROR. TESTS NOT FINISHED. #1111
I have been battling this issue for weeks and until now, I have just worked around it (ignored testing this part of application) but I have to face it head on now and dont know what to do.
I am simply trying to perform a simple test POST using API suite.
If there are any suggestions, it would be greatly appreciated!
FATAL ERROR. TESTS NOT FINISHED.
Test method causing error
I get this behaviour when a previous request using the REST module fails, but the suite keeps running. The next time the module is used, the internal client gets into a weird state and is nulled out.
@mikeerickson Do you have a more complete example with stack trace? If not, I'll try and reproduce; though I'm using Specify in my examples. I don't know that this is a "bug" more than it is lack of a good queue to the developer as to what failed. Perhaps (depending on what Mike brings back) this may be impetus to improve error checking in the module to make sure it's in a clean state between tests. Might be hard to do.
As an anecdote, I modified https://github.com/Codeception/Codeception/blob/2.0/src/Codeception/Module/REST.php#L72 to clone the client from the connection module and the error goes away because it forces a new copy of the client to be made every time. Doubtful that this is the cleanest solution and I have no idea where this causes issues, if any.
I'll give it a day and if Mike doesn't respond, I'll put together a small suite demonstrating the issue I've seen related to this using Specify. It just so happens that Specify's "isolated code block" feature brings this issue to light more often whereby a failure in one block leaves the module-level client in an inconsistent / dirty state.
https://github.com/Codeception/Codeception/blob/2.0/src/Codeception/Lib/InnerBrowser.php#L49 is referenced by the REST module (which retrieves client) and InnerBrowser nullifies its client after a test is complete.
Worded this ambiguously; made some edits. It's late here
Leaving this alone for now to let Mike pipe up. I don't have a debugger tonight so I can't set breakpoints to give more information, but I'll try to get that together.
- Using can/cant causes cleanup code to be called, which causes an exception calling subsequent tests: for instance calling canSee() followed by amOnPage (or canSee twice). - Fixes Codeception#1647 Codeception#1354 and Codeception#1111 - Same as pull request Codeception#1807 - but against master and with some added test code
- Using can/cant causes cleanup code to be called, which causes an exception calling subsequent tests: for instance calling canSee() followed by amOnPage (or canSee twice). - Fixes Codeception#1647 Codeception#1354 and Codeception#1111 - Same as pull request Codeception#1807 - but with some added test code