Skip to content

Routes Test relies on compilation to finish, but doesn't wait for it #1734

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
1 of 2 tasks
knagaitsev opened this issue Mar 23, 2019 · 1 comment
Closed
1 of 2 tasks

Comments

@knagaitsev
Copy link
Collaborator

  • Operating System: Windows 7
  • Node Version: 8.10.0
  • NPM Version: 6.4.1
  • webpack Version: 4.29.0
  • webpack-dev-server Version: 3.2.1
  • This is a bug
  • This is a modification request

Code

The request made to /webpack-dev-server by Routes.test.js relies on the webpack compilation to complete: https://github.com/webpack/webpack-dev-server/blob/master/test/Routes.test.js#L58

Expected Behavior

Compilation should finish before the test starts. As stated here: #847 the server callback can be called before compilation is done.

Actual Behavior

If the compilation takes a long time, this test fails, since it does not wait for compilation to finish before testing.

For Bugs; How can we reproduce the behavior?

Bring the test here: https://github.com/webpack/webpack-dev-server/blob/master/test/Routes.test.js#L58 to the top, and the test will probably run before compilation is done. The only reason it has been succeeding is because there are many tests before it, and compilation has time to finish.

Additional

I ran into this while working on a different fix which extended the compilation time. I will make a PR with the fix for this test. I think this is the only test where this mistake is made, but I'm not 100% sure.

@knagaitsev knagaitsev changed the title Routes Test relies on compilation to finish Routes Test relies on compilation to finish, but doesn't wait for it Mar 23, 2019
@alexander-akait
Copy link
Member

Fixed #1735

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