busterjs / buster

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

console.log() outputs twice #386

Closed dominykas closed 10 years ago

dominykas commented 11 years ago

It seems that logs appear twice. I have the most trivial setup: https://gist.github.com/dymonaz/7156195 (see output.txt) and only one browser attached.

/Users/dominykas/devel/experiments/buster-called-twice
├─┬ buster@0.7.7
│ ├── async@0.2.9
│ ├── bane@1.0.0
│ ├── buster-autotest@0.4.0
│ ├── buster-server-cli@0.3.0
│ ├── buster-sinon@0.7.0
│ ├── buster-static@0.6.2
│ ├── buster-syntax@0.4.2
│ ├── buster-test@0.7.4
│ ├── buster-test-cli@0.8.2
│ ├── evented-logger@1.0.0
│ ├── formatio@1.0.2
│ ├── lodash@1.0.1
│ ├── platform@1.0.0
│ ├── referee@1.0.1
│ ├── referee-sinon@1.0.1
│ ├── samsam@1.1.0
│ ├── sinon@1.7.3
│ ├── stack-filter@1.0.0
│ └── when@1.8.1
alexturek commented 10 years ago

Confirmed with the exact same package versions when running 'npm list -g --depth=1'

dkl-ppi commented 10 years ago

This issue should be fixed since buster-test@0.7.5. Can you confirm that?

geekq commented 10 years ago

I'm experiencing this issue with buster 0.7.8 Beta 5:

$ buster --version
Buster.JS version 0.7.8 Beta 5

Every message to console.log is printed twice.

dkl-ppi commented 10 years ago

@geekq: Which version of buster-test do you have installed?

geekq commented 10 years ago
$ npm list -g --depth=1|grep buster-test
│ ├── buster-test@0.7.5
│ ├── buster-test-cli@0.8.2
geekq commented 10 years ago

BTW the gist prepared by @dymonaz is a very good minimal example representing the problem. And can be also used as a regression test.

@dwittner Is the problem reproducible in your environment with that gist?

geekq commented 10 years ago

Just tried it again with the newest buster-test

npm install buster-test
git clone https://gist.github.com/7156195.git
cd 7156195/
buster-server &
open http://localhost:1111/
buster-test

Chrome 33.0.1750.152, Ubuntu Chromium dostuff should actually do stuff
    [LOG] Setting up 1
    [LOG] Setting up 1
    [LOG] Check if stuff is done 2
    [LOG] Check if stuff is done 2
1 test, 1 assertion, 1 runtime ... OK
dkl-ppi commented 10 years ago

@geekq, until just now i had run the gist example only within the development environment of buster and there i could reproduce it only with the version 0.7.4 of buster-test. The issue was gone when i updated to buster-test 0.7.5. Just now i tried the gist example with a regular installed version of buster and could reproduce the issue even with version 0.7.5 of buster-test. Thus i have to investigate the issue further.

dkl-ppi commented 10 years ago

My fault. The issue is indeed fixed by the code changes i thought, but the changes were not released with 0.7.5 of buster-test. The changes were excluded from the release. So you have to wait for version 0.7.6.

geekq commented 10 years ago

Glad, that it is fixed and we know where we stay.

Will wait for 0.7.6 or checkout the master branch. Thank you!

BTW, which commit https://github.com/busterjs/buster-test/commits/master is the fix?

dkl-ppi commented 10 years ago

My guess is, that the issue was incidentally fixed by removing the runtime throttler. I think the runtime throttler has caused the emitted log event to be handled a second time. Unfortunately you can't use the master branch at the moment, because the brief reporter currently throws an error if you use console.log. Right now I try to clarify how to fix it. I recommend you to wait for 0.7.6. I will try to release it the next days.

dkl-ppi commented 10 years ago

If you update buster to version 0.7.13, the packages buster-test, buster-test-cli and buster-static are also updated and the issue should be fixed.

dominykas commented 10 years ago

Seems to work here. Thank you, good sir!

geekq commented 10 years ago

The fix (0.7.13) works for me too. Thanks!