Skip to content
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

UnitTest: warning about redefined subroutines #297

Closed
bschmalhofer opened this issue Aug 3, 2020 · 3 comments
Closed

UnitTest: warning about redefined subroutines #297

bschmalhofer opened this issue Aug 3, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bschmalhofer
Copy link
Contributor

When running the test suite there are many warnings about redefined subroutines. The impression is that the behavior is as desired, and that the warnings should masked. Needs to be investigated.

@bschmalhofer bschmalhofer added the enhancement New feature or request label Aug 3, 2020
@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Aug 3, 2020
@bschmalhofer
Copy link
Contributor Author

These warning stem from Kernel::System::UnitTest::Helper::_ MockPerlTimeHandling(), when some modules are reloaded. For some reason the warnings are not easily turned off with no warnings;, even when Module::Refresh is reused.

I'll investigate whether the reloading of the modules is really needed.

@bschmalhofer
Copy link
Contributor Author

The reloading of the modules is necessary. https://perldoc.perl.org/CORE.html#OVERRIDING-CORE-FUNCTIONS states that core functions must be overridden at compile time. This is no problem when each test script really runs as a seperate script. But when otobo.Console.pl is used then dynamic loading takes place. This means that the core functions are not overridden at compile time.

So, let's live with the warnings until #192 is implemented.

@bschmalhofer
Copy link
Contributor Author

Tests run as expected again. Closing.

@bschmalhofer bschmalhofer self-assigned this Nov 28, 2021
@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.1, OTOBO 10.1.1 Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant