Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job timeout does not set error.timeout property #10

Closed
Ehesp opened this issue Oct 4, 2016 · 1 comment
Closed

Job timeout does not set error.timeout property #10

Ehesp opened this issue Oct 4, 2016 · 1 comment
Milestone

Comments

@Ehesp
Copy link
Member

Ehesp commented Oct 4, 2016

When forcing a job to timeout, the expected result of the onFailure result should have a timeout property in the error object, in this case it doesn't:

  it('Should emit a failure if job timeout is set and hit', function (done) {
    global.singleJob = function singleJob() {
      return new Promise((resolve) => {
        setTimeout(resolve, 2000);
      });
    };

    Hook.create('test', {
      runs: 'singleJob',
    }, {
      timeout: 1000,
    }).onFailure(result => {
      assert.equal(result.error.timeout, true);
      done();
    });
  });

result:

{ job: 
  { id: 'test-citvo32bg0003uhvdl3i3k3e7',
    worker_id: 'citvo31ie0000uhvd9hv0z3dx',
    status: 'failed',
    runs: 'singleJob' },
 error: {},
 output: null }
@Ehesp Ehesp added this to the v2.0.0 milestone Oct 5, 2016
@Salakar
Copy link
Member

Salakar commented Oct 6, 2016

Fixed in up coming v2.

@Salakar Salakar closed this as completed Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants