We have a suite of integration tests that take about 2 hours to complete.
Currently our flow is that each feature branch runs the integration tests, and only if the branch is updated from master and the tests completed, it can be merged to master. So naturally, it happens quite a lot that you start the tests when your branch is updated, but by the time it ends, there are new changes to master, and you must update your branch and re-run the tests...
We are obviously doing something wrong. But we are not sure what.
Should we allow to merge the feature branch even without updating and testing? it feels risky...
Should we allow to merge, but have another run on master before deployment to production?