swhitty/FlyingFox

starting server port

Morkrom opened this issue · 2 comments

I'm using this in a UI test environment. It seems like there's a silent issue at times after starting a server for UI testing where continued execution ceases at the log "starting server port". I have tried:

  1. Starting a server once in a task as documented in readme and stopping it once with the test bundle for the entire run. Issues launching the test app persist using this method.

  2. Starting a server directly using the async setup methods for a given test case. In this case it hangs up on execution.

  3. Starting a server in a task alongside launching the app in a setup method. This method works when I launch the app first, although not always.

Is anyone else using FF as a dependency of UI testing and have found a happiest path for using in such an environment?

I do use FlyingFox as a HTTP server within both unit and UI tests in various projects.

Are you starting and stopping the server multiple times? When starting you will need to wait for the server to start listening on the supplied port before its ready for tests, but also when stopping you should wait for the server Task to complete before attempting to start a new one.

HTTPServerTests.swift has an example of this pattern.

Thanks @Morkrom for the feedback. I will close the issue for now but please do reply if it is not working for you.