Skip to content

Commit

Permalink
Debuggings
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Jan 13, 2025
1 parent dd5db37 commit 89096b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 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,8 @@ def group(cls) -> str | None:
return None

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

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "FullSnapshotEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "SnapshotUpdateEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "EndEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "AnalysisEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "AnalysisStatusEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "AnalysisTimeEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "RunModelStatusEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "RunModelTimeEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "RunModelUpdateBeginEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "error_msg"

Check failure on line 217 in src/ert/run_models/base_run_model.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "RunModelDataEvent" of "FullSnapshotEvent | SnapshotUpdateEvent | EndEvent | AnalysisEvent | AnalysisStatusEvent | <7 more items>" has no attribute "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 @@ -4,6 +4,7 @@
import logging
import os
import threading
import traceback
from datetime import datetime
from pathlib import Path
from textwrap import dedent
Expand Down Expand Up @@ -614,7 +615,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 89096b7

Please sign in to comment.