You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/08/19 02:12:33 UTC
[GitHub] [logging-log4cxx] rm5248 opened a new pull request, #115: LOGCXX-527: mock the clock for tests
rm5248 opened a new pull request, #115:
URL: https://github.com/apache/logging-log4cxx/pull/115
Mock the clock for unit tests to make them more reliable and configurable.
This also cleans up some APR calls to make us less dependent on APR and
more on standard C++ features
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] ams-tschoening commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
ams-tschoening commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1220521496
I reliably get the following error on my Windows 10 with VS 2022:
```
99% tests passed, 1 tests failed out of 67
Total Test time (real) = 70.09 sec
The following tests FAILED:
61 - timebasedrollingtest (Failed)
Errors while running CTest
Output from these tests are in: C:/Users/tschoening/Documents/Svn/Src/Libs/trunk/C++/Logging/log4cxx/master/src/out/build/x64-Debug/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
```
```
----------------------------------------------------------
61/67 Testing: timebasedrollingtest
61/67 Test: timebasedrollingtest
Command: "C:/Users/tschoening/Documents/Svn/Src/Libs/trunk/C++/Logging/log4cxx/master/src/out/build/x64-Debug/src/test/cpp/rolling/timebasedrollingtest.exe" "-v"
Directory: C:/Users/tschoening/Documents/Svn/Src/Libs/trunk/C++/Logging/log4cxx/master/src/src/test/resources
"timebasedrollingtest" start time: Aug 19 12:21 Mitteleurop�ische Sommerzeit
Output:
----------------------------------------------------------
LC_CTYPE: German_Germany.1252
timebasedrollingtest: Advancing one second
01:00:01,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test1:436 - Hello---0
01:00:01,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test1:436 - Hello---1
01:00:02,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test1:436 - Hello---2
01:00:02,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test1:436 - Hello---3
01:00:03,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test1:436 - Hello---4
Advancing one second
01:00:01,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test2:464 - Hello---0
01:00:01,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test2:464 - Hello---1
01:00:02,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test2:464 - Hello---2
01:00:02,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test2:481 - Hello---3
01:00:03,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test2:481 - Hello---4
Advancing one second
01:00:01,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test3:510 - Hello---0
01:00:01,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test3:510 - Hello---1
01:00:02,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test3:510 - Hello---2
01:00:02,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test3:510 - Hello---3
01:00:03,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test3:510 - Hello---4
Advancing one second
01:00:01,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test5:588 - Hello---0
01:00:01,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test5:588 - Hello---1
01:00:02,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test5:588 - Hello---2
01:00:02,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test5:588 - Hello---3
01:00:03,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test5:588 - Hello---4
Advancing one second
01:00:01,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test6:617 - Hello---0
01:00:01,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test6:617 - Hello---1
01:00:02,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test6:617 - Hello---2
01:00:02,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test6:617 - Hello---3
01:00:03,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#test6:617 - Hello---4
Advancing one second
01:00:01,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#create_directories:690 - Hello---0
01:00:01,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#create_directories:690 - Hello---1
01:00:02,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#create_directories:690 - Hello---2
01:00:02,500 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#create_directories:690 - Hello---3
01:00:03,000 [0x00000cd4] DEBUG log4j.TimeBasedRollingTest#create_directories:690 - Hello---4
Line 695: true != File(fileNames[x]).exists(pool)
FAILED 1 of 6
Failed Tests Total Fail Failed %
===================================================
timebasedrollingtest 6 1 16.67%
create_directories
<end of output>
Test time = 0.30 sec
----------------------------------------------------------
Test Failed.
"timebasedrollingtest" end time: Aug 19 12:21 Mitteleurop�ische Sommerzeit
"timebasedrollingtest" time elapsed: 00:00:00
----------------------------------------------------------
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] ams-tschoening commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
ams-tschoening commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1221255981
> I'm also a little confused as to why it failed for you but succeeded with the github actions build. Timezone issue maybe?
Don't think so, it's more about starting with a new empty output test directory each time and generic file names. Isn't that the case for GitHub actions by default?
I had those file names from past test executions and [file names created during rollover change according to if a file was available already](https://github.com/apache/logging-log4cxx/commit/380392204e59a88db7825f784358a36ed85e37a3#diff-98cce87f9e9828c51b6e434af362d912e5b9103bb22157f3abd86fb534d9329dR341) or not. Some names get the last write time then instead of what the test suite itself assumes to be the current time. The tests succeeded when I emptied my output directory as well. Though, at some point I had the impression that the change EPOCH vs. current time influenced something as well, but that might be wrong.
The point is, that all tests run reliably for me now even without cleaning the output directory. That's why I enabled test4 and test7 again. Thinking of it again, the former assumptions about test number and stuff during setup weren't too reliable as well. I think it's better to have this stuff removed and made explicit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] asfgit merged pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
asfgit merged PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] ams-tschoening commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
ams-tschoening commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1221004429
I've created a new branch with some changed handling of witness files and status. Am somewhat sure that I implemented the former approach to the best of my knowledge, but having an additional look now it doesn't seem to reliable and even wrong. Please have a look and let's decide if to ignore that or create a new PR or whatever. Sorry for the inconvenience!
https://github.com/apache/logging-log4cxx/tree/LOGCXX-527_TS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] ams-tschoening commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
ams-tschoening commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1220996674
Sorry, I forgot to create a local branch for my tests and changes and accidently committed `master`. Can't reset to a former state, so reverted things, but won't change too much about the PR anymore. :-/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] rm5248 commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
rm5248 commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1221177052
I'm also a little confused as to why it failed for you but succeeded with the github actions build. Timezone issue maybe?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] ams-tschoening commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
ams-tschoening commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1221012280
Sorry, I forgot to create a local branch for my tests and changes and accidently committed `master`. Can't reset to a former state, so reverted things, but won't change too much about the PR anymore. :-/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] ams-tschoening commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
ams-tschoening commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1221004926
Sorry, I forgot to create a local branch for my tests and changes and accidently committed `master`. Can't reset to a former state, so reverted things, but won't change too much about the PR anymore. :-/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] ams-tschoening commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
ams-tschoening commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1220678020
Found the problem: Whenever an old file `timebasedrolling_create_dir.log` exists already, the first rollover uses the last write time of that file in the name and that's not compatible with the implemented generic checks. The function `deleteGenericLogFilePerTest` dealt with that for some other tests already, but using a different naming scheme for files.
Though, even after changing the file name to a generic one things still don't work in case. Most likely because `deleteGenericLogFilePerTest` uses `num_test`, which seems to be some internal status of the current test number. The problem is that with some commented and therefore not used tests, `test6` isn't really test number 6 anymore and wrongly assumed file names will be deleted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4cxx] rm5248 commented on pull request #115: LOGCXX-527: mock the clock for tests
Posted by GitBox <gi...@apache.org>.
rm5248 commented on PR #115:
URL: https://github.com/apache/logging-log4cxx/pull/115#issuecomment-1221170341
I thought all of those errors had been fixed(which is basically why I had just turned off tests 4 and 7). I can rebase off of current master and see what happens(and re-open at that point I guess?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org