WHAT'S NEW?
Loading...

Testing sofwater - Find the next port available

Index

  • Intro
  • Problem
  • Solution


Intro

Nowadays, tests are a mandatory thing to assure the quality of your code. For this reason, developers typically set up CI environments where they can run any sort of tests: unit, functional, integration...

Problem

This one is a very small post about something I found very interesting and I want to preserve it for the future. I end up with some functional tests running on my CI boxes that were failing all the time. After some investigation I found the reason. It was produced by an unexpected error in the build machine that was preventing the release of the port I use for testing.

I think this might be an scenario where you can find yourself, specially with functional tests where you need to probe certain behaviour with frameworks like PhantomJs and so...

Snippet

Please see here below a small code snippet to find the next available port:



0 comments:

Post a Comment