Skip to content

Fix #4847 - OpenStudio logging behaves differently on Windows/Linux#4852

Merged
tijcolem merged 4 commits intodevelopfrom
4847_CLI_RubyLogger
Apr 25, 2023
Merged

Fix #4847 - OpenStudio logging behaves differently on Windows/Linux#4852
tijcolem merged 4 commits intodevelopfrom
4847_CLI_RubyLogger

Conversation

@jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Apr 5, 2023

Pull request overview

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

@jmarrec jmarrec added component - CLI Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Apr 5, 2023
@jmarrec jmarrec self-assigned this Apr 5, 2023
@jmarrec jmarrec force-pushed the 4847_CLI_RubyLogger branch from 19f81dc to 69385d4 Compare April 5, 2023 08:59
@jmarrec
Copy link
Collaborator Author

jmarrec commented Apr 5, 2023

Before fix at 5d61bc7 we get the windows error in action, see log https://ci.openstudio.net/blue/organizations/jenkins/openstudio-incremental-windows/detail/PR-4852/3/pipeline#step-61-log-8

Running: D:\git\OpenStudio\build\Products\openstudio.exe execute_ruby_script D:\git\OpenStudio\src\cli\test\logger_test.rb

0 [test] <0> Warn
1 [test] <1> Error
2 [test] <1> Error
3 LOGGER - STDOUT Warn
4 [test] <1> Error
5 LOGGER - STDOUT Warn
6 LOGGER - STDOUT Error

Traceback (most recent call last):
  File "D:/git/OpenStudio/src/cli/test/run_test_logger.py", line 54, in <module>
    raise IOError(f"Expected 3 lines, got {n}")
OSError: Expected 3 lines, got 7


2/2 Test #3637: OpenStudioCLI.Labs.test_logger_rb ...***Failed    1.08 sec

Namespace(labs=True, logger_file=WindowsPath('D:/git/OpenStudio/src/cli/test/logger_test.rb'), os_cli_path=WindowsPath('D:/git/OpenStudio/build/Products/openstudio.exe'))

Running: D:\git\OpenStudio\build\Products\openstudio.exe labs execute_ruby_script D:\git\OpenStudio\src\cli\test\logger_test.rb

0 [test] <0> Warn
1 [test] <1> Error
2 [test] <1> Error
3 LOGGER - STDOUT Warn
4 LOGGER - STDOUT Error

Traceback (most recent call last):
  File "D:/git/OpenStudio/src/cli/test/run_test_logger.py", line 54, in <module>
    raise IOError(f"Expected 3 lines, got {n}")
OSError: Expected 3 lines, got 5

@shorowit
Copy link
Contributor

shorowit commented Apr 6, 2023

I can't speak to the correctness of the implementation, but I tried this out on Windows and Ubuntu, and they both gave the desired result. So I can confirm that this fixes the issue.

@shorowit
Copy link
Contributor

shorowit commented Apr 6, 2023

Although I noticed that when I run the CLI using labs on Windows, it doesn't work. Not sure if that's specific to this PR.

On Windows, first command (without labs) is successful, second command (with labs) is not:

image

On Ubuntu, it works both with and without labs:

image

@shorowit
Copy link
Contributor

shorowit commented Apr 7, 2023

@jmarrec @tijcolem I tried the Windows labs command using build 5eaa0d8 and the same issue occurs there. So it's not caused by this PR. I'll see if I can find when it started failing.

@shorowit
Copy link
Contributor

shorowit commented Apr 7, 2023

Found the bug, see #4856.

@jmarrec jmarrec force-pushed the 4847_CLI_RubyLogger branch from 992da3a to 8301544 Compare April 24, 2023 15:14
@tijcolem tijcolem merged commit e62d497 into develop Apr 25, 2023
@jmarrec jmarrec deleted the 4847_CLI_RubyLogger branch June 12, 2023 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component - CLI Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenStudio logging singleton issues (especially on Windows) when using interpreted bindings (ruby measures)

4 participants