Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Timeout #405

Closed
silentorb opened this issue Apr 9, 2014 · 2 comments
Closed

Timeout #405

silentorb opened this issue Apr 9, 2014 · 2 comments
Assignees
Labels

Comments

@silentorb
Copy link

The documentation says "When an asynchronous test runs for more than timeout ms, the runner will abort it and emit a test:timeout event."

That implies test:timeout will not affect synchronous tests. However, when I extend the timeout property the test pauses for that length of time even if the test is synchronous. This is also the case when I use when.js promises that successfully resolve.

var buster = require("buster");
var assert = buster.referee.assert;
var when = require('when');

buster.testCase("Simple test", {
    setUp: function () {
        this.timeout = 10000;
    },
    "always true": function () {
        assert(true);
    },
    "using promises": function () {
        var def = when.defer();
        setTimeout(function () {
            assert(true);
            def.resolve();
        }, 10);
        return def.promise;
    }
});

When I run "always true" or "using promises" either individually or together, the tester will pause for ten seconds.

This is with Buster 0.7.11.

@dwittner dwittner added the Bug label Apr 9, 2014
@dwittner dwittner self-assigned this Apr 9, 2014
@dwittner
Copy link
Member

That's strange. I can't reproduce this weird behaviour, neither with buster 0.7.11 nor with 0.7.13. Can you please reinstall buster and try again? Do you use a local or global installation of buster and on which OS? What does your buster.js file look like and how do you run your tests?

@silentorb
Copy link
Author

I'm using both a global and local install of buster on WIndows 7. I uninstalled and reinstalled it both globally and locally and that has seemed to fix the problem, so something must have gone wrong with my files.

Thank you for your time!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants