| Ticket UUID: | 5137b4387019d0e118d958fb2b51139219ba9978 | ||
| Title: | clock.test failures with -singleproc 1 on Windows | ||
| Type: | Bug | Created on: | 2025-07-31 06:40:17 |
| Submitter: | apnadkarni | Assigned to: | nobody |
| Subsystem: | - New Builtin Commands | Severity: | Minor |
| Priority: | 5 Medium | Last modified: | 2025-08-05 15:58:44 |
| Status: | Closed | Closed by: | dgp |
| Resolution: | Fixed | Closed on: | 2025-08-05 15:58:44 |
| Version: | 8.7+ | ||
| Description: | ||||
|
Failures disappear with -Od or -singleproc 0. Unix does not exhibit failures but MinGW build also show failures. Note only clock.test is run so not a result of other test files.
| ||||
| User Comments: | ||||
sebres added on 2025-07-31 10:36:06:
No idea, why I'm abrupt responsible for that errors (since this tests exist almost since begin of clock, and they are older than 20 years and I saw such errors already with 8.5), but OK... The tests have only conditionally the issue with -singleproc 1, and it goes to the "timing" problem - the tests using "system" locale, for this TCL would need registry module under windows, but this cannot be used unless really installed. The root of the issue - tcltest also uses the clock ensemble (to output "Tests began at" on start), and the registry would not be found there, so a later usage in the same interpreter (if registry package gets provided by -load parameters) may be too late, so may cause that the registry would not be tried to load anymore, so after all the retrieved locale may be different. I made at some point (see [0c05a83862b9967c]) the registry package loadable in development environment, even uninstalled (pkgIndex tried to load it relative build folder). But it was ultimately reverted. The next fix I made in this direction was the loading of -load in tcltest to correct time (cannot find the commit now). Anyway I cannot reproduce it in MinGW (have no VS to hand right now), with both ways:
Tests ended at Thu Jul 31 12:23:58 CEST 2025
all.tcl: Total 17472 Passed 17472 Skipped 0 Failed 0
Sourced 2 Test Files.
$ make -j8 tcltest && ./tcltest.sh -file 'clock*.test' -singleproc 1
make: Nothing to be done for `tcltest'.
Tests running in interp: d:/prj/tcl9.0/win/Release_MGW64/tcltest.exe
Tests located in: D:/prj/tcl9.0/tests
Tests running in: T:/Temp
Temporary files stored in T:/Temp
Test files sourced into current interpreter
Running tests that match: *
Skipping test files that match: l.*.test
Only running test files that match: clock*.test
Tests began at Thu Jul 31 12:24:34 CEST 2025
clock-ivm.test
Validity default mode: off
clock.test
Validity default mode: off
Tests ended at Thu Jul 31 12:24:40 CEST 2025
all.tcl: Total 17472 Passed 17472 Skipped 0 Failed 0
Sourced 2 Test Files.
But I'd try to find the roots if I'd get VS to hand. apnadkarni added on 2025-07-31 11:06:07:
No, I didn't assign to you because I thought you are responsible :-) Rather I felt you are most knowledgeable about the clock implementation. I can reproduce it with MinGW as well so may be it is some configuration specific to my system. I don't think it has any urgency so no need for you to waste time on it. I'll come back to it at some point. sebres added on 2025-07-31 13:46:23:
No problem... I tried to improve tests setups/cleans and rewrite them more system/locale/TZ independent, can you please test [557de3c0e552e76b]. apnadkarni added on 2025-07-31 14:06:01:
Progress! Now down to a single bug each in clock.test and clock-ivm.test. Both VC++ and MINGW show same failure.
sebres added on 2025-07-31 17:11:07:
I have no idea what happens there (and cannot reproduce it)... The test is extended now with more informative result in error case. Can you try it again, please? apnadkarni added on 2025-08-01 05:34:48:
The With -singleproc 0 (passing):
With -singleproc 1 (fail):
You were on the right track when you mentioned registry. Bisect shows:
Note the GOOD commit does not show any of the other failures I reported in the ticket either. The failing commit removes the registry dlls from the build, presumably to keep them out of the zipfs. A build without embedding zipfs ( So it has something to do with absence of the registry dll. I'm still puzzled as to
sebres added on 2025-08-01 10:33:48:
Oops... No, it looks worse than I thought: Because And this may point to something like wrong cache invalidation (e. g. of the current loaded TZ data) or something similar. And potentially, this is completely different bug, happening only on certain circumstances (e. g. the only difference I see at the moment is the "IST" vs. "+0530" as your current timezone). Anyway, thx for testing, I will try to figure it out. sebres added on 2025-08-01 12:25:44:
Well, it shall now be fixed in [ba25401d6eaac4b2] - it was basically simple and as assumed the cache. The circumstances are indeed "noregistry" and fallback to :localtime TZ, what by change of TZ env (so often as in test suite) may miss the change of epoch (since obtained twice and second time Can you please give it a try again? I'll also provide new test later that covers this (no matter, with -singleproc 1 or 0). apnadkarni added on 2025-08-01 13:05:15:
Looks good! I'm actually happy to know it was a real bug so your time spent was not a loss. Are the changes you made to the other tests (other than 38.2) still necessary? ``` c:\src\tcltk\bisect\win>nmake /f makefile.vc /s /nologo test TESTFLAGS="-f clock*.test -singleproc 1" Tests running in interp: c:/src/tcltk/bisect/win/Release_AMD64_VC1939/tcltest90.exe Tests located in: C:/src/tcltk/bisect/tests Tests running in: C:/src/tcltk/bisect/win Temporary files stored in C:/src/tcltk/bisect/win Test files sourced into current interpreter Running tests that match: * Skipping test files that match: l.*.test Only running test files that match: clock*.test Tests began at 2025-08-01 18:29:09 +0530 clock-ivm.test Validity default mode: off clock.test Validity default mode: off Tests ended at 2025-08-01 18:29:15 +0530 all.tcl: Total 17472 Passed 17472 Skipped 0 Failed 0 Sourced 2 Test Files. ``` sebres added on 2025-08-01 13:55:10:
> Are the changes you made to the other tests (other than 38.2) still necessary? I think yes (at least it is not wrong), because [557de3c0e5] fixes the setup of test registry, and previously ::tcl::clock::NoRegistry did nothing, since unused anymore in new clock engine (and the tests would be wrong if no registry is there, they imply a wrapper ::testClock::registry would work only if _hasRegistry returns 1). Thus I'd add more tests and merge it hereafter to all affected branches. sebres added on 2025-08-04 16:06:40:
In [aded3f3f0220b422] added test coverage for the switch of epoch and TZ-environment variable for the case if there is no registry. dgp added on 2025-08-04 18:00:03:
The changes made to address this ticket included a change to
the tcltest package. When the tcltest package changes, it needs
a version number bump, and to be kept in sync on all branches.
I made a start at this, but then I see another concern...
The change to tcltest gives me doubts.
- set timeCmd {clock format [clock seconds]}
+ set timeCmd {clock format now -format "%Y-%m-%d %H:%M:%S %Z" -locale en}
This is forcing the "timeCmd" used by the tcltest package to
construct timestamps to always use the "en" locale.
This seems like a very consequential thing to force on every
user of the tcltest package in (presumably) a patch release.
This will change output reporting by tcltest when run in non-en
locales, right? Many tcltest users who process tcltest output
are likely to see their expectations overturned, right?
Can't the testing of the clock command use other mechanisms to
induce tcltest to act (as if it is) in the en locale?
What am I missing?
sebres added on 2025-08-04 18:57:58:
> This will change output reporting by tcltest when run in non-en locales, right? Well, it is not well correct, how [1b7d5ee5b46a96e8] says - it would now always output an ISO timestamp (which is obviously never locale dependent, since has only numeric values), but... This change basically serves multiple purposes and it'd:
In particular, for German user the difference in timestamp may look: # either like this (e. g. on uninstalled Tcl the locale may remain "en"): - Mon Aug 04 20:49:33 +0200 2025 + 2025-08-04 20:49:42 +0200 # or like this (e. g. on installed Tcl, the locale may be obtained from system): - Mo Aug 04 20:52:40 +0200 2025 + 2025-08-04 20:49:42 +0200 If you mean ISO timestamp is not good for the output of start/end time in the test-suite, we can revert [1b7d5ee5b46a96e8] - with the possible consequences I mentioned above. But they would happen only on certain circumstances. dgp added on 2025-08-05 15:58:44:
Thanks for the reply. To summarize my understanding.
* Yes, the change results in user-visible changes to tcltest output
* The revised output is more robust, predictable, and standards
compliant than the prior output.
I plan to take the following steps.
* Bump the tcltest version on the changed branches to 2.6.0
* When version tcltest 2.6.0 is included in a Tcl release, include
release notes information about the change.
* I will not make tcltest 2.6 a part of Tcl 8.6.* releases (following
the existing state where the change was not backported there).
| ||||
