Strider-CD / strider-github

Github provider for strider
25 stars 34 forks source link

Tests of master gets triggered while a pr check is running #47

Open phiros opened 9 years ago

phiros commented 9 years ago

When running a PR job it can happen that in parallel someone merges changes to master. This triggers a job start on the master branch while the PR job is still running. bug2

In addition to this (unexpected) behavior the output of the PR job becomes unavailable (just a black field is displayed where previously the test output was displayed; like a job which is scheduled but did not run yet) as strider assumes the latest (the master job) is the only active job. bug

Observed with the latest version of strider + the docker-runner, the strider-github and the strider-custom plugins. I think I observed this bug because the tests I run can take a long time to finish (compiling a large C code base).

knownasilya commented 9 years ago

Is this related to Strider-CD/strider#745?

phiros commented 9 years ago

Just checked the logs, doesn't seem to be related to Strider-CD/strider#745 (I greped for 'TypeError', 'died' and 'error'; couldn't find any of these terms in the log). I think this Bug is only related to the code in the github plugin (either this or something in strider itself). Also: I've noticed this behavior several times and only in the described constellation (e.g. a PR job is running and somebody merges something to the master branch).

phiros commented 9 years ago

Also noteworthy: I just observed that as soon as the merge/master job is done other jobs are getting processed (regardless of being a PR job or a merge/master job). The whole having two jobs running situation only stops when the original PR job (the job which ran before the merge/master job) job stops. After the original PR job stopped I was able to access its output (like for any other finished job)

phiros commented 9 years ago

And another one: I now noticed a situation in which three PR jobs run concurrently which is kind of bad for what I am doing since each job uses large amounts of CPU time and hard disk space... All of the jobs are PR jobs now: bildschirmfoto vom 2015-07-01 23 59 39

knownasilya commented 9 years ago

Interesting, so the PR is handled differently then the commit. Sounds like something here: https://github.com/Strider-CD/strider-github/blob/master/lib/webhooks.js#L82

phiros commented 9 years ago

Hmm, maybe. However, what irritates me is that in the end they both just send out the "job.prepare" event and in the simple runner there is just one queue associated with each project (if I am not mistaken).... Maybe there is a problem with the handling of the job.prepare event?

knownasilya commented 9 years ago

Very possible. Could you have a look, I'm currently roadtripping.