diff --git a/Makefile b/Makefile index a7de0a1..5cabec7 100644 --- a/Makefile +++ b/Makefile @@ -9,19 +9,19 @@ FLAGS= PYTHON= python -Wignore help: - @echo 'Makefile for NDB for Google App Engine ' - @echo ' ' - @echo 'Usage: ' - @echo ' make bench Task creation benchmark ' - @echo ' make keybench Key comparison benchmark ' - @echo ' make gettaskletrace Test race conditions in get_tasklet' - @echo ' make stress Threadsafe Py27 Stress Test ' - @echo ' make race Race condition tests for NDB ' - @echo ' make multithread_test Multi-threading torture test ' - @echo ' make repl Custom REPL with NDB loaded ' - @echo ' ' - @echo 'NOTE: This file is being wound down and will be fully ' - @echo ' replaced by tox.ini. ' + @echo 'Makefile for NDB for Google App Engine ' + @echo ' ' + @echo 'Usage: ' + @echo ' make bench Task creation benchmark ' + @echo ' make keybench Key comparison benchmark ' + @echo ' make get_tasklet_race Test race conditions in get_tasklet' + @echo ' make stress Threadsafe Py27 Stress Test ' + @echo ' make race Race condition tests for NDB ' + @echo ' make multithread_test Multi-threading torture test ' + @echo ' make repl Custom REPL with NDB loaded ' + @echo ' ' + @echo 'NOTE: This file is being wound down and will be fully ' + @echo ' replaced by tox.ini. ' bench: @@ -30,8 +30,8 @@ bench: keybench: PYTHONPATH=. $(PYTHON) keybench.py $(FLAGS) -gettaskletrace: - PYTHONPATH=. $(PYTHON) gettaskletrace.py $(FLAGS) +get_tasklet_race: + PYTHONPATH=. $(PYTHON) get_tasklet_race.py $(FLAGS) stress: PYTHONPATH=. $(PYTHON) stress.py $(FLAGS) diff --git a/gettaskletrace.py b/get_tasklet_race.py similarity index 94% rename from gettaskletrace.py rename to get_tasklet_race.py index cae6f07..ad3af00 100644 --- a/gettaskletrace.py +++ b/get_tasklet_race.py @@ -1,5 +1,6 @@ """Runs an infinite loop to find race conditions in context get_tasklet.""" +from ndb import google_imports # For path fixing. from google.appengine.ext import testbed from ndb import model diff --git a/race.py b/race.py index 8372d36..4d59f68 100644 --- a/race.py +++ b/race.py @@ -9,6 +9,7 @@ import threading import time +from ndb import google_imports # For path fixing. from google.appengine.api import memcache from google.appengine.ext import testbed diff --git a/stress.py b/stress.py index df6baab..4a5365b 100644 --- a/stress.py +++ b/stress.py @@ -5,6 +5,7 @@ import threading import time +from ndb import google_imports # For path fixing. from google.appengine.api import apiproxy_stub_map from google.appengine.datastore import datastore_stub_util @@ -107,5 +108,6 @@ def main(): tb.deactivate() + if __name__ == '__main__': main()