Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Jan 13, 2025
1 parent 96d3029 commit 73cc4da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/ert/run_models/base_run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import shutil
import time
import traceback
import uuid
from abc import ABC, abstractmethod
from collections import defaultdict
Expand Down Expand Up @@ -212,6 +213,10 @@ def group(cls) -> str | None:
return None

def send_event(self, event: StatusEvents) -> None:
if hasattr(event, "error_msg"):
traceback.print_stack()
print(event.error_msg)

self._status_queue.put(event)

def send_smoother_event(
Expand Down
9 changes: 8 additions & 1 deletion tests/ert/ui_tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import stat
import threading
import traceback
from datetime import datetime
from pathlib import Path
from textwrap import dedent
Expand Down Expand Up @@ -615,7 +616,13 @@ def test_that_pre_post_experiment_hook_works(capsys):
)

for mode in [ITERATIVE_ENSEMBLE_SMOOTHER_MODE, ES_MDA_MODE, ENSEMBLE_SMOOTHER_MODE]:
run_cli(mode, "--disable-monitor", "poly.ert")
try:
run_cli(mode, "--disable-monitor", "poly.ert")
except Exception as e:
print(f"{mode}")
print(traceback.format_exc())
print("\n".join(traceback.format_tb(e.__traceback__)))
print(str(e.__traceback__))

captured = capsys.readouterr()
assert "first" in captured.out
Expand Down

0 comments on commit 73cc4da

Please sign in to comment.