Question: i've created a new branch called "addroles" and did a checkout to it and did some changes but when i returned to master to see the old version before i do the changes on the "addroles" i've found that they were brought to the master and waiting for commit like the new branch. I really don't know what this is related to.

Answer: 
I managed to reproduce your issue and it's what I thought, the Cloud Scheduler is not waiting for the response from the Cloud Function. If you have a CF that takes at most 9 minutes to execute, even if you extend the deadline to 9 minutes, this is only on the CF side and the CS will stop waiting, leaving the request's status as UNKNOWN (therefore, FAILED).

If you are creating the CS from the sdk, you should take a look at the parameter [--attempt-deadline](https://cloud.google.com/sdk/gcloud/reference/beta/scheduler/jobs/create/http#--attempt-deadline), which will allow the CS to wait more.

If you don't need to see the response from the CS, you could try using [Pub/Sub](https://cloud.google.com/scheduler/docs/tut-pub-sub) to start the process without waiting.
What we found and confirmed by Google Support:
1. Job created through GCP Cloud Console only works for 60secs and it returns FAILED even if the Cloud Function is set for maximum of 540secs. Note, CF will execute successfully.
2. To overcome, create the job through command line using gcloud SDK command:
<https://cloud.google.com/sdk/gcloud/reference/scheduler/jobs/create/http>

It returned SUCCESS when we set the --attempt-deadline=1200s, which is above 540secs CF execution time.

Hope this helps