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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add console command that prints needed envvars #9

Merged
merged 3 commits into from Mar 4, 2016
Merged

Add console command that prints needed envvars #9

merged 3 commits into from Mar 4, 2016

Conversation

allardhoeve
Copy link
Contributor

When running nosetests or python manage.py test there are often left-over processes that are never reaped. As I use watch to run the tests every tenth of a second, that results in many, many processes 馃槃

I've traced this back to the re-exec that is performed. I would like to avoid that re-exec cleanly, but currently I have to have read the libfaketime source code to find out which envvars it wants. And keep the vars in sync ofcourse.

So, let's add a console script that prints out the needed envvars, like ssh-agent does on start. Then you can call libfaketime and it will output:

export LD_PRELOAD="/home/.../vendor/libfaketime/src/libfaketime.so.1"
export FAKETIME_DID_REEXEC=true

This can then be used at startup:

eval $(libfaketime)
nosetests

@allardhoeve
Copy link
Contributor Author

@gertjanol

@simon-weber
Copy link
Owner

Huh, any idea where the orphan processes are coming from? We can track that separately if you'd like; making the non-hack way easier is a fine workaround.

One quick suggestion: can we make the top-level executable python-libfaketime instead? I'm worried about conflicting with the original c library.

@allardhoeve
Copy link
Contributor Author

No, I have no idea where they are coming from. And I do not really have the time to check it out. It might have something to do with the fact that we run 1k tests or so and use all CPU cores to run them. The nosetests multi process plugin is... not very nice.

But having a nice supported way of circumventing the respawn seems nice in any case.

@allardhoeve
Copy link
Contributor Author

Also, updated!

@allardhoeve
Copy link
Contributor Author

And finally, some bonus documentation 馃槃

@simon-weber
Copy link
Owner

Looks great; thanks!

simon-weber added a commit that referenced this pull request Mar 4, 2016
Add console command that prints needed envvars
@simon-weber simon-weber merged commit 394341d into simon-weber:master Mar 4, 2016
@allardhoeve
Copy link
Contributor Author

Cool. If you upload to pypi, can you give me a ping?

@allardhoeve allardhoeve deleted the envvars-console-command branch March 4, 2016 14:30
@simon-weber
Copy link
Owner

Sure, I'll try to do that tonight.

simon-weber added a commit that referenced this pull request Mar 4, 2016
@simon-weber
Copy link
Owner

@allardhoeve ok, 0.3.0 is up!

@allardhoeve
Copy link
Contributor Author

Thanks! Works like a charm!

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

Successfully merging this pull request may close these issues.

None yet

2 participants