-
Notifications
You must be signed in to change notification settings - Fork 110
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
Refactor everserver 2 #9777
base: main
Are you sure you want to change the base?
Refactor everserver 2 #9777
Conversation
3058d26
to
249e947
Compare
249e947
to
d0b2ca4
Compare
CodSpeed Performance ReportMerging #9777 will not alter performanceComparing Summary
|
1e6e488
to
071bbbc
Compare
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.
Looks good, some minor comments and questions
) | ||
|
||
if self._everest_config.simulator.queue_system.name == "local": | ||
# if run_model._queue_config.queue_system == QueueSystem.LOCAL: |
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.
Should be able to just use the commented out line, as it is lower case everywhere now.
is_done = False | ||
exit_code = None | ||
# loop unil the optimization is done | ||
while not is_done: |
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.
Very minor and only if you a agree, but suggest a rename to: done
, think it reads a bit better.
@@ -41,7 +41,7 @@ | |||
from everest.util import makedirs_if_needed | |||
|
|||
|
|||
@pytest.mark.flaky(reruns=5) | |||
# @pytest.mark.flaky(reruns=5) |
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.
No longer flaky?
from everest.util import makedirs_if_needed | ||
|
||
|
||
def _string_exists_in_file(file_path, string): | ||
return string in Path(file_path).read_text(encoding="utf-8") | ||
|
||
|
||
@pytest.mark.flaky(reruns=5) | ||
# @pytest.mark.flaky(reruns=5) |
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.
No longer flaky?
async def server_running(): | ||
while True: | ||
event = await driver.event_queue.get() | ||
if isinstance(event, FinishedEvent) and event.iens == 0: | ||
return | ||
|
||
driver = await start_server(config, debug=True) | ||
try: | ||
wait_for_server(config.output_dir, 120) | ||
start_experiment( | ||
server_context=ServerConfig.get_server_context(config.output_dir), | ||
config=config, | ||
) | ||
except (SystemExit, RuntimeError) as e: | ||
raise e | ||
await server_running() |
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.
Perhaps make this a small function for reuse? Looks like it can be used in the test below as well?
def extract_errors_from_file(path: str): | ||
with open(path, encoding="utf-8") as f: | ||
content = f.read() | ||
return re.findall(r"(Error \w+.*)", content) | ||
|
||
|
||
def wait_for_server_simple( |
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.
Would it be possible to join this with wait_for_server
?
Issue
Resolves #9290
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"'
)When applicable