Fossil SCM
Minor bug in test_start_server: only read a whole port number
Commit
e83517252d38d40183ce8f989855c43399d7bcf3fd62f65edacc9698ca7516d6
Parent
69903cd865e33e4…
1 file changed
+5
-3
+5
-3
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -1002,17 +1002,19 @@ | ||
| 1002 | 1002 | set pid [eval $command] |
| 1003 | 1003 | if {!$::is_windows} { |
| 1004 | 1004 | set stopArg $pid |
| 1005 | 1005 | } |
| 1006 | 1006 | # 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]} | |
| 1008 | 1011 | set port "" |
| 1009 | 1012 | for {set i 0} {$i < 100 && $port eq ""} {incr i} { |
| 1010 | 1013 | after 100 |
| 1011 | 1014 | set output [read_file $outFileName] |
| 1012 | - regexp -line {Listening for .+ requests on (?:TCP port )?(?:\S*:)?(\d+)} \ | |
| 1013 | - $output -> port | |
| 1015 | + regexp $listening $output -> port | |
| 1014 | 1016 | } |
| 1015 | 1017 | if {$port eq ""} { |
| 1016 | 1018 | test_stop_server $stopArg $pid $outFileName |
| 1017 | 1019 | error "fossil server did not report its port: $output" |
| 1018 | 1020 | } |
| 1019 | 1021 |
| --- 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 |