Fossil SCM

Minor bug in test_start_server: only read a whole port number

danshearer 2026-11-17 13:12 UTC test-suite-new
Commit e83517252d38d40183ce8f989855c43399d7bcf3fd62f65edacc9698ca7516d6
1 file changed +5 -3
+5 -3
--- test/tester.tcl
+++ test/tester.tcl
@@ -1002,17 +1002,19 @@
10021002
set pid [eval $command]
10031003
if {!$::is_windows} {
10041004
set stopArg $pid
10051005
}
10061006
# The server prints its port in a line such as "Listening for HTTP
1007
- # requests on TCP port localhost:8081, IPv4 and IPv6".
1007
+ # requests on TCP port localhost:8081, IPv4 and IPv6". The port is
1008
+ # followed by a comma or the end of the line.
1009
+ set listening {Listening for [^\n]+ requests on }
1010
+ append listening {(?:TCP port )?(?:\S*:)?(\d+)[,\r\n]}
10081011
set port ""
10091012
for {set i 0} {$i < 100 && $port eq ""} {incr i} {
10101013
after 100
10111014
set output [read_file $outFileName]
1012
- regexp -line {Listening for .+ requests on (?:TCP port )?(?:\S*:)?(\d+)} \
1013
- $output -> port
1015
+ regexp $listening $output -> port
10141016
}
10151017
if {$port eq ""} {
10161018
test_stop_server $stopArg $pid $outFileName
10171019
error "fossil server did not report its port: $output"
10181020
}
10191021
--- test/tester.tcl
+++ test/tester.tcl
@@ -1002,17 +1002,19 @@
1002 set pid [eval $command]
1003 if {!$::is_windows} {
1004 set stopArg $pid
1005 }
1006 # The server prints its port in a line such as "Listening for HTTP
1007 # requests on TCP port localhost:8081, IPv4 and IPv6".
 
 
 
1008 set port ""
1009 for {set i 0} {$i < 100 && $port eq ""} {incr i} {
1010 after 100
1011 set output [read_file $outFileName]
1012 regexp -line {Listening for .+ requests on (?:TCP port )?(?:\S*:)?(\d+)} \
1013 $output -> port
1014 }
1015 if {$port eq ""} {
1016 test_stop_server $stopArg $pid $outFileName
1017 error "fossil server did not report its port: $output"
1018 }
1019
--- test/tester.tcl
+++ test/tester.tcl
@@ -1002,17 +1002,19 @@
1002 set pid [eval $command]
1003 if {!$::is_windows} {
1004 set stopArg $pid
1005 }
1006 # The server prints its port in a line such as "Listening for HTTP
1007 # requests on TCP port localhost:8081, IPv4 and IPv6". The port is
1008 # followed by a comma or the end of the line.
1009 set listening {Listening for [^\n]+ requests on }
1010 append listening {(?:TCP port )?(?:\S*:)?(\d+)[,\r\n]}
1011 set port ""
1012 for {set i 0} {$i < 100 && $port eq ""} {incr i} {
1013 after 100
1014 set output [read_file $outFileName]
1015 regexp $listening $output -> port
 
1016 }
1017 if {$port eq ""} {
1018 test_stop_server $stopArg $pid $outFileName
1019 error "fossil server did not report its port: $output"
1020 }
1021

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button