busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

Ramp server reuses promises #218

Closed cjohansen closed 12 years ago

cjohansen commented 12 years ago

It seems the capture server will try to resolve already resolved promises under some conditions.

To reproduce

Here's the trace I got:

$ buster server
buster-server running on http://localhost:1111

/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/when/when.js:246
                throw new Error("already completed");
          ^
Error: already completed
    at alreadyCompleted (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/when/when.js:246:11)
    at Object.resolve (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/when/when.js:189:4)
    at Object._onImprisoned (/home/christian/projects/busterjs/modules/buster-capture-server/lib/slave.js:114:36)
    at /home/christian/projects/busterjs/modules/buster-capture-server/lib/pubsub-client.js:82:47
    at Object.trigger (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/faye/node/faye-node.js:383:19)
    at Object.distributeMessage (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/faye/node/faye-node.js:666:30)
    at Object._deliverMessage (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/faye/node/faye-node.js:1068:20)
    at Object.<anonymous> (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/faye/node/faye-node.js:1007:12)
    at Object.pipeThroughExtensions (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/faye/node/faye-node.js:529:44)
    at Object.receiveMessage (/home/christian/projects/busterjs/modules/buster-capture-server/node_modules/faye/node/faye-node.js:1003:10)
augustl commented 12 years ago

Thanks, only had a stack trace from someone else, didn't know how to reproduce.

samgiles commented 12 years ago

I seem to encounter your first issue 'The test run should halt (this is probably another bug...)' quite consistently when running the unit tests from https://github.com/ftlabs/ftcolumnflow with buster over a WiFi connection with an iPad 5.0.1 device with Safari 5.1. The test it halts on seems to vary.

What I did notice with the above is that the slave refreshes during the tests, and then the tests halt. But like I said it's strange because the test that it halts on seems to vary, for example sometimes it passes (so I don't think it's the tests).

I wish I could take a look to help further as I've began to encounter both these bugs. If you need anymore information let me know, I'm going to see if I can see anything in the meantime.

Cheers

Sam

augustl commented 12 years ago

Fixed in latest HEAD.