You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have acceptance suite and functional suite (they execute in that order). In functional suite, very first test relies on Phiremock response but because Phiremock is shut down after acceptance suite and initialised on functional suite, that very first test fails with curl error (something like failed to connect to 0.0.0.0).
I can fix this issue with start_delay config eg. I can set it to 1 and it will most likely work fine. But the problem is that on my build environment, the machine is a bit slow sometimes and relying on fixed amount of seconds to wait for Phiremock may not always work.
For example, in most cases 1 second delay is fine but sometimes it's not enough. I can set this delay to something like 30 and this will "fix" the issue, but it will make the tests slow. And it may still break if my build env will get slow and that 30 seconds delay will not be enough.
What I want to propose is to introduce a new setting like "wait_until_ready" (true/false) where if set to true, it will check if Phiremock is actually ready to serve requests. This could be done by simply polling Phiremock every second. We could also have another config like "wait_timeout" where you can set some timeout eg. 60 so after 60 seconds it will just stop polling and throw error (to prevent it going indefinitely).
edit
Now I started wondering, why even Phiremock has to shut down after each suite? Is there a way to make it running without shutting down until all tests end?
The text was updated successfully, but these errors were encountered:
I'm using Phiremock with codeception.
I have acceptance suite and functional suite (they execute in that order). In functional suite, very first test relies on Phiremock response but because Phiremock is shut down after acceptance suite and initialised on functional suite, that very first test fails with curl error (something like failed to connect to 0.0.0.0).
I can fix this issue with start_delay config eg. I can set it to 1 and it will most likely work fine. But the problem is that on my build environment, the machine is a bit slow sometimes and relying on fixed amount of seconds to wait for Phiremock may not always work.
For example, in most cases 1 second delay is fine but sometimes it's not enough. I can set this delay to something like 30 and this will "fix" the issue, but it will make the tests slow. And it may still break if my build env will get slow and that 30 seconds delay will not be enough.
What I want to propose is to introduce a new setting like "wait_until_ready" (true/false) where if set to true, it will check if Phiremock is actually ready to serve requests. This could be done by simply polling Phiremock every second. We could also have another config like "wait_timeout" where you can set some timeout eg. 60 so after 60 seconds it will just stop polling and throw error (to prevent it going indefinitely).
edit
Now I started wondering, why even Phiremock has to shut down after each suite? Is there a way to make it running without shutting down until all tests end?
The text was updated successfully, but these errors were encountered: