Appium - Parallel Execution (Grid)

OOHH man,
parallel execution killing me. :stuck_out_tongue_winking_eye: . though any how i made it but still there is one problem i am facing

i am running two different test parallely on different device
like

  1. 2 appium node running with two devices, ports and josn config
  2. Selenium grid is running and both node registered

Now i am setting capability dynamically (getting parameter from suite file )
ex:
Test1


Test2


when i run suite
its taking devices randomly like sometime test1 runs on emulator and some time on device1

Is there any one facing same issue ?