Skip to content
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

[BUG] The --dev mode spawns more servers without clearing previous ones. #249

Closed
sansyrox opened this issue Jul 26, 2022 · 6 comments · Fixed by #278
Closed

[BUG] The --dev mode spawns more servers without clearing previous ones. #249

sansyrox opened this issue Jul 26, 2022 · 6 comments · Fixed by #278
Labels
good first issue Good for newcomers

Comments

@sansyrox
Copy link
Member

Description

The --dev mode is going in infinite recursion when a file is changed in the directory.

To check, you can do
lsof -i tcp:5000

Expected Behavior

Handle a base case that might have been missed here.

Environment:

  • Host OS: every

[Optional] Additional Context


@sansyrox sansyrox added the good first issue Good for newcomers label Jul 26, 2022
@guilefoylegaurav
Copy link
Contributor

Hey @sansyrox I am interested in taking this up. Can you kindly elaborate more on this?

  • What kind of result am I expected to see with --dev and lsof -i tcp:5000?
  • It seems that hot reload is not really working on my system? I ran the base_routes.py with the --dev flag and cannot see changes being reflecting in the browser immediately when I alter anything in the integration_tests directory?

@sansyrox
Copy link
Member Author

sansyrox commented Sep 2, 2022

Hi @guilefoylegaurav ,

Firstly, thank you for your interest.

You will notice changes when you change integration_tests/base_routes.py file.

When you type lsof -i tcp:5000 , you should not see any output after the dev server has been killed. However, if you run pytest integration_tests, you will see many processes that have to be killed manually.

@guilefoylegaurav
Copy link
Contributor

Hello @sansyrox

However, if you run pytest integration_tests, you will see many processes that have to be killed manually

  • This problem is coming up because in the teardown in conftest.py, process.terminate() has been used which does not kill the child processes spawned

  • Replacing process.terminate() with os.killpg(os.getpgid(process.pid), signal.SIGKILL) would solve the problem

  • Also the pytest fixtures inside configtest.py have to be scoped to session level

Please feel free to let me know what your thoughts are regarding this

@sansyrox
Copy link
Member Author

sansyrox commented Sep 4, 2022

@guilefoylegaurav , great spot. I had fixed this issue thrice and it still appeared, so I assumed it would be the same this time too. 🤣

Do you want to create a PR for the same?

@guilefoylegaurav
Copy link
Contributor

Sure! If you say so, I'm ready to raise a PR

@sansyrox
Copy link
Member Author

sansyrox commented Sep 4, 2022

@guilefoylegaurav , perfect then :D

sansyrox pushed a commit that referenced this issue Sep 18, 2022
* fix: fix problem of process persistence post test session
* replace process.terminate() with kill() equivalent
* scope pytest fixtures to session level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
2 participants