|
46 | 46 | create_live_table_index_disc_only/1, del_table_index_ram/1, |
47 | 47 | del_table_index_disc/1, del_table_index_disc_only/1, |
48 | 48 | idx_schema_changes_ram/1, idx_schema_changes_disc/1, |
49 | | - idx_schema_changes_disc_only/1]). |
| 49 | + idx_schema_changes_disc_only/1, stacktrace_return/1]). |
50 | 50 |
|
51 | 51 | -export([do_nested/1]). |
52 | 52 |
|
@@ -75,7 +75,7 @@ all() -> |
75 | 75 | select_reverse_index, all_keys, |
76 | 76 | transaction, transaction_counters, |
77 | 77 | {group, nested_activities}, {group, index_tabs}, |
78 | | - {group, index_lifecycle}]. |
| 78 | + {group, index_lifecycle}, stacktrace_return]. |
79 | 79 |
|
80 | 80 | groups() -> |
81 | 81 | [{nested_activities, [], |
@@ -1620,3 +1620,27 @@ idx_schema_changes(Config, Storage) -> |
1620 | 1620 | ?match([{Tab, 16, 66}], rpc:call(N1, mnesia, dirty_index_read, [Tab, 66, Idx])), |
1621 | 1621 |
|
1622 | 1622 | ?verify_mnesia(Nodes, []). |
| 1623 | + |
| 1624 | +%% Check return value of aborted mnesia:transaction/1 |
| 1625 | + |
| 1626 | +stacktrace_return(suite) -> []; |
| 1627 | +stacktrace_return(Config) -> |
| 1628 | + [_N] = ?acquire_nodes(1, Config), |
| 1629 | + Throw = fun() -> throw(test) end, |
| 1630 | + Exit = fun() -> exit(test) end, |
| 1631 | + Error = fun() -> error(test) end, |
| 1632 | + |
| 1633 | + ?match({aborted, {throw, test}}, mnesia:transaction(Throw)), |
| 1634 | + ?match({aborted, test}, mnesia:transaction(Exit)), |
| 1635 | + ?match({aborted, {test, [{?MODULE, _, _, _} | _]}}, mnesia:transaction(Error)), |
| 1636 | + |
| 1637 | + Nested = fun(F) -> |
| 1638 | + fun() -> |
| 1639 | + {aborted, Reason} = mnesia:transaction(F), |
| 1640 | + mnesia:abort(Reason) |
| 1641 | + end |
| 1642 | + end, |
| 1643 | + |
| 1644 | + ?match({aborted, {throw, test}}, mnesia:transaction(Nested(Throw))), |
| 1645 | + ?match({aborted, test}, mnesia:transaction(Nested(Exit))), |
| 1646 | + ?match({aborted, {test, [{?MODULE, _, _, _} | _]}}, mnesia:transaction(Nested(Error))). |
0 commit comments