Skip to content

Pub run test performs http-request twice #451

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

Closed
YuriKulaghin opened this issue Aug 18, 2016 · 8 comments
Closed

Pub run test performs http-request twice #451

YuriKulaghin opened this issue Aug 18, 2016 · 8 comments

Comments

@YuriKulaghin
Copy link

See simplest run_test.zip with cllient and server - client sends http-request to server, server responses with 'Hello, world!'. When test.html is launched directly by Dartium (WebStorm -> Run 'test.html') then server receives one request, as expected. When test is launched by pub run test -p dartium test\test.html server recieves two equal requests! Why?! Effect is reproduced on Windows and Linux, with dart-sdk/dartium 1.18.1 and older, with test 0.12.15+3 and 0.12.14+1.

@zoechi
Copy link

zoechi commented Aug 18, 2016

I wouldn't expect other people to download arbitrary zip files and expand them on their local disc ;-)
It would be better to publish the repo case as GitHub repository where the code can be browsed online.

@YuriKulaghin
Copy link
Author

Thanks, Gunter, run_test.zip is published as https://github.com/YuriKulaghin/dartlang_test_issue451.

@zoechi
Copy link

zoechi commented Aug 18, 2016

Could this be because of <script type="application/dart" src="test.dart"></script> in our index.html? Can you please try without?

@nex3
Copy link
Member

nex3 commented Aug 18, 2016

Yeah, it looks to me like @zoechi is right: you're double-including your test script.

@nex3 nex3 closed this as completed Aug 18, 2016
@vpigrad
Copy link

vpigrad commented Aug 18, 2016

You suggested doing that to us in order to fix --pause-after-load. That is required for debugging in the browser and to run the test at the command line. See:

#409

Again, we need to be able to debug to develop tests and also be able to run them at the command line. We have thousands of tests.

@nex3
Copy link
Member

nex3 commented Aug 18, 2016

I believe what I said was "be aware that you're using test in a non-standard way" and "I can't offer any guarantees that that won't be broken" 😉. The only supported way of debugging tests is to use --pause-after-load.

@zoechi
Copy link

zoechi commented Aug 19, 2016

@vpigrad As a non-standard way, you can comment in/out this script tag in order to be able to debug from WebStorm, or what I'm usually doing is, to create a copy of that file (without _test in the name) for debugging purposes only containing the dart script tag (and not the x-dart-test tag).

@YuriKulaghin
Copy link
Author

Thanks for all, it's true - second script including in the body of html-file (for debug with browser) gives double script running under pub run test.

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

4 participants