このコードを使用して機能テストの一部としてタスクを実行できます。機能テスト中のタスクキューとパイプラインAPIのテスト
def run_tasks():
taskq = apiproxy_stub_map.apiproxy.GetStub('taskqueue')
tasks = taskq.GetTasks("default")
taskq.FlushQueue("default")
try:
while tasks:
for task in tasks:
url, body, headers, method = task["url"], \
base64.b64decode(task["body"]), \
task["headers"], \
task["method"]
try:
res = Request.blank(url,
body=body,
headers=headers,
method=method).get_response(wsgi_app)
if res.status_int != 200:
log.error("%s\n%s" % (url, str(res)))
except Exception:
log.error(url, exc_info=True)
tasks = taskq.GetTasks("default")
taskq.FlushQueue("default")
finally:
pass
はしかし、パイプラインタスクは、試みの1に
「パイプラインIDのための受信した評価タスク 『[いくつかのid]』のメッセージとここまで準備ができていないだろう 『 』を出し爆撃します:[いつの間にか後で]」
関連する情報源はここにあります。
+++ b/src/pipeline/pipeline/pipeline.py Wed Apr 04 20:01:12 2012 -0400
@@ -1946,6 +1952,7 @@
if pipeline_record.next_retry_time is not None:
retry_time = pipeline_record.next_retry_time - _RETRY_WIGGLE_TIMEDELTA
if self._gettime() <= retry_time:
+ # error under unit tests
detail_message = (
'Received evaluation task for pipeline ID "%s" on attempt %d, '
'which will not be ready until: %s' % (pipeline_key.name(),
私は が私のテストスイートでAppEngineのAPIを起動しますが、それは十分では に思われないことをコードで_RETRY_WIGGLE_TIMEDELTAにパッチを適用猿と考えます。
私のコードでは、私の テストスイートが非常に遅く動作するようになるまで待たずに、私は迷っています。
アイデア?