From 781211bdcf7f653c5c174893e6955dc887517436 Mon Sep 17 00:00:00 2001 From: avdudchenko <33663878+avdudchenko@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:04:43 -0700 Subject: [PATCH] test fix --- backend/app/internal/flowsheet_manager.py | 3 +-- backend/app/internal/parameter_sweep.py | 8 ++++++-- electron/ui/cypress/support/commands.js | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/app/internal/flowsheet_manager.py b/backend/app/internal/flowsheet_manager.py index dafed7d..a02c1fe 100644 --- a/backend/app/internal/flowsheet_manager.py +++ b/backend/app/internal/flowsheet_manager.py @@ -605,10 +605,9 @@ def get_number_of_subprocesses(self): currentNumberOfSubprocesses = item[0]["value"] # _log.info(f'number of subprocesses is: {currentNumberOfSubprocesses}') # prevent user from overspecifying number of sub processes on accident and killing thier system - print("get_number_of_subprocesses", currentNumberOfSubprocesses) + if currentNumberOfSubprocesses > maxNumberOfSubprocesses: currentNumberOfSubprocesses = maxNumberOfSubprocesses - print("get_number_of_subprocesses", currentNumberOfSubprocesses) return currentNumberOfSubprocesses, maxNumberOfSubprocesses def set_number_of_subprocesses(self, value): diff --git a/backend/app/internal/parameter_sweep.py b/backend/app/internal/parameter_sweep.py index edbda83..6137ab1 100644 --- a/backend/app/internal/parameter_sweep.py +++ b/backend/app/internal/parameter_sweep.py @@ -130,6 +130,11 @@ def run_analysis( ) if custom_do_param_sweep is None: custom_do_param_sweep_kwargs = None + + if number_of_subprocess == 1: + parallel_back_end = "Serial" + else: + parallel_back_end = "MultiProcessing" ps = ParameterSweep( csv_results_file_name=results_path, optimize_function=solve_function, @@ -137,10 +142,9 @@ def run_analysis( custom_do_param_sweep=custom_do_param_sweep, custom_do_param_sweep_kwargs=custom_do_param_sweep_kwargs, reinitialize_before_sweep=False, - parallel_back_end="MultiProcessing", + parallel_back_end=parallel_back_end, number_of_subprocesses=number_of_subprocess, ) - print("number_of_subprocess ", number_of_subprocess) global_results = ps.parameter_sweep( build_model=build_function, build_sweep_params=ParameterSweepReader()._dict_to_params, diff --git a/electron/ui/cypress/support/commands.js b/electron/ui/cypress/support/commands.js index 56b35bd..4dfd643 100644 --- a/electron/ui/cypress/support/commands.js +++ b/electron/ui/cypress/support/commands.js @@ -81,7 +81,7 @@ Cypress.Commands.add('solve_flowsheet', () => { url: 'http://localhost:8001/flowsheets/**', }).as('run'); cy.findAllByRole('button', {name: /run/i}).eq(0).click(); - cy.wait('@run', {timeout: 180000}); + cy.wait('@run', {timeout: 600000}); }) /**