forked from hail-is/hail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[query] fix and enforce that workers transmit stack traces (hail-is#1…
…4122) Co-authored-by: Edmund Higham <[email protected]>
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
hail/python/test/hail/test_exceptions_from_workers_have_stack_traces.py
This file contains 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,23 @@ | ||
import hail as hl | ||
import pytest | ||
import re | ||
|
||
from hail.utils.java import FatalError | ||
from .helpers import qobtest | ||
|
||
|
||
@qobtest | ||
def test_exceptions_from_workers_have_stack_traces(): | ||
ht = hl.utils.range_table(10, n_partitions=10) | ||
ht = ht.annotate(x=hl.int(1)//hl.int(hl.rand_norm(0, 0.1))) | ||
pattern = ( | ||
'.*' + | ||
re.escape('java.lang.Math.floorDiv(Math.java:1052)') + | ||
'.*' + | ||
re.escape('(BackendUtils.scala:') + | ||
'[0-9]+' + | ||
re.escape(')\n') + | ||
'.*' | ||
) | ||
with pytest.raises(FatalError, match=re.compile(pattern, re.DOTALL)): | ||
ht.collect() |
This file contains 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