-
Notifications
You must be signed in to change notification settings - Fork 115
Traceback histories #130
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
Merged
Merged
Traceback histories #130
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
53d4ad5
Initial commit traceback histories branch
Pauleuh 5001128
fix config import
sylvinus b8a704d
Updated process & tests for traceback_histories
Pauleuh e7e60c2
Removing useless prints
Pauleuh a5fb10c
Removing double import
Pauleuh fa76803
Adding worker id if it exists
Pauleuh 941edbf
Testing ob order
Pauleuh 041a6fd
Update of the API for traceback_histories
Pauleuh 54ec966
Front update for traceback histories
Pauleuh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| SAVE_TRACEBACK_HISTORY = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,3 +159,36 @@ def test_retry_max_retries_zero(worker): | |
|
|
||
| job = Job(job_id).fetch() | ||
| assert job.data["status"] == "maxretries" | ||
|
|
||
|
|
||
| def test_retry_traceback_history(worker): | ||
|
|
||
| worker.start(flags="--config tests/fixtures/config-tracebackhistory.py") | ||
| # delay = 0 should requeue right away. | ||
|
|
||
| worker.send_task( | ||
| "tests.tasks.general.Retry", {"queue": "noexec", "delay": 60}, block=True, accept_statuses=["retry"] | ||
| ) | ||
|
|
||
| job = worker.mongodb_jobs.mrq_jobs.find()[0] | ||
|
|
||
| assert len(job["traceback_history"]) == 1 | ||
| assert not job["traceback_history"][0].get("original_traceback") | ||
|
|
||
| worker.send_task( | ||
| "tests.tasks.general.RetryOnFailed", {"queue": "default", "delay": 1}, block=True, accept_statuses=["retry"] | ||
| ) | ||
|
|
||
| job = worker.mongodb_jobs.mrq_jobs.find({ | ||
| "path": "tests.tasks.general.RetryOnFailed"})[0] | ||
|
|
||
| assert len(job["traceback_history"]) == 1 | ||
| assert "InRetryException" in job["traceback_history"][0].get("original_traceback") | ||
| time.sleep(2) | ||
| worker.send_task("mrq.basetasks.cleaning.RequeueRetryJobs", {}, block=True) | ||
| time.sleep(2) | ||
| job = worker.mongodb_jobs.mrq_jobs.find({ | ||
| "path": "tests.tasks.general.RetryOnFailed"})[0] | ||
|
|
||
| assert len(job["traceback_history"]) == 2 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would be great here to test the order of the tracebacks too |
||
| assert job["traceback_history"][0]["date"] < job["traceback_history"][1]["date"] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saving the worker ID would be great too. (get_current_worker(), which may return None)