How can I start job after a a trigger is finished successfully?

I have a simple CI script which contains one trigger and one job, right now the trigger and the job always run in parallel, Is there a way for me to run them sequentially? (I would like to run test only after the trigger_build is completed successfully)

Below is my sample script:

stages:
- trigger_build
- test

trigger_build:
stage: trigger_build
script:
- “curl -X POST -F token=mytoken -F ref=ci-test https://nj-gitlab.nec-labs.com/api/v4/projects/831/trigger/pipeline

test:
stage: test
script: cat file1.txt | grep -q “Hello”