Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Defer starting the SAS session until needed #3448

Merged
merged 3 commits into from
Jan 21, 2025
Merged

Conversation

jsiirola
Copy link
Member

Fixes # .

Summary/Motivation:

This resolves an issue with the SAS interface where the SAS session was being started in the interface __init__.py. This meant that any time the interface was created it immediately tried to connect - which, if you are offline, hung until the connection timed out (~10 seconds). With these changes (and some changes with how SAS tests are skipped), running the tests offline only hits the timeout once (and not a dozen times).

Changes proposed in this PR:

  • Move the logic to start the SAS session into a helper method
  • Only start the SAS session when needed (for the available() check or for solve())
  • Update the SAS tests to minimize the number of times available() needed to be checked.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@mrmundt mrmundt self-requested a review January 14, 2025 19:57
@blnicho blnicho merged commit bd3e444 into Pyomo:main Jan 21, 2025
32 checks passed
@jsiirola jsiirola deleted the sas-available branch January 21, 2025 20:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants