Heavily Updated Answer
After reading the problem more closely and also agreeing with sentiments expressed by @j6t I need to alter my advice... this workflow as a whole is problematic. Don't do what I said ( don't branch feature from test ). Branch from master, then make a variant of the branch called feature-test which you create in case of a conflict by doing one of the two conflict resolution paths i mentioned ( merge feature into test, or test into feature and resolve the conflicts ) and that branch can be requested for merge to test.. if items come up make fixes to your initial branch and then merge that branch into feature-test again. this way you keep fixes found from testing in feature in feature and you keep conflict resolutions in feature-test, so that in the end you can merge feature to master, with stronger safety that fixes of issues from feature's testing are in feature but not conflict resoultion or stray materials from test.
My big issue with this is that test shouldn't generally exist or be used. They should test your branch by merging master into it and testing it. Otherwise what you are testing is not what you are merging to master, and it doesnt sound like testing is performed on master.
Now if you have a bunch of related features, or you have a big change such that other things SHOULD be aware of and take account for it things change. In that case you should use an integration branch that you merge into for testing, and you should potentially branch off the integration branch for the features that are targeted for the integration branch, which will all go to master together.
Overall if test is not merged to master but you test off of it, and you keep fixing things on test you end up in a wierd state where you aren't testing what will actually go to master which could both hide and introduce bugs that you would otherwise catch in testing.
Some things I said before still hold:
There is no SIMPLE solution for resolving merge conflicts; you have to resolve them manually otherwise git would have done it for you.
The workflow and constraints make this a horrible situation. They are effectively testing a branch can significantly vary from what master will be.
I honestly don't see value from the test branch currently, if test is not merged to master and vice versa, and only see negatives stemming from it.
Personally if this was the workflow I was presented with I would be discussing changing it, or heading toward a new job unless there is significant test automation that is carried out by CI/CD before the branch is allowed to merge to master. It's a recipe for disaster. You're going to constantly be wasting time crafting conflict resolutions to be able to merge to test that are thrown away, and then possibly doing different resolutions to merge to master.
The testers should do their testing and have automation in place on your branch once its PR is opened to be merged to master. They should mark it passed when they have validated it. I would do this by having two different sets of gatekeeper approvals required for the merge to master, someone from code review group, and someone from qa ( if that can't be done via CI/CD ).
- Whoever is in the appropriate leadership role, to be deciding which changes should be merged when, should be initiating the merges to
master once a feature is both validated (reviewed and tested) and desired to be brought into master.
- If a
feature is validated and sits because it's not yet wanted in master, than it sits there ready and waiting.
- If additional commits go to the
feature after testing, the testing needs to be verified again (this is why automation/CI/CD is best), and someone should update the code review to approve it again.
- Finally, there should also be a run of the testing on
master commits to make sure that if something is independently added to master that didn't conflict with feature that the two both being present doesn't cause a problem.
It also boils down to goals: should master always be deployable? Or should it always be buildable, mostly stable, where you work from, and periodically you cut a release from master that has been more deeply tested? ( In which case you should absolutely tag a release commit so that patches can be created on top of the released version, and then ported/merged/cherry-picked as needed to master. There is no right or wrong answer to this question. Different projects/workflows and scenarios have different requirements.