"Fossies" - the Fresh Open Source Software Archive

Member "redis-7.0.5/tests/sentinel/tests/11-port-0.tcl" (21 Sep 2022, 1239 Bytes) of package /linux/misc/redis-7.0.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Tcl/Tk source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 source "../tests/includes/init-tests.tcl"
    2 
    3 test "Start/Stop sentinel on same port with a different runID should not change the total number of sentinels" {
    4         set sentinel_id [expr $::instances_count-1]
    5         # Kill sentinel instance
    6         kill_instance sentinel $sentinel_id
    7 
    8         # Delete line with myid in sentinels config file
    9         set orgfilename [file join "sentinel_$sentinel_id" "sentinel.conf"]
   10         set tmpfilename "sentinel.conf_tmp"
   11         set dirname "sentinel_$sentinel_id"
   12 
   13         delete_lines_with_pattern $orgfilename $tmpfilename "myid"
   14 
   15         # Get count of total sentinels
   16         set a [S 0 SENTINEL  master mymaster]
   17         set original_count [lindex $a 33]
   18 
   19         # Restart sentinel with the modified config file
   20         set pid [exec_instance "sentinel" $dirname $orgfilename]
   21         lappend ::pids $pid
   22 
   23         after 1000
   24 
   25         # Get new count of total sentinel
   26         set b [S 0 SENTINEL master mymaster]
   27         set curr_count [lindex $b 33]
   28 
   29         # If the count is not the same then fail the test
   30         if {$original_count != $curr_count} {
   31                 fail "Sentinel count is incorrect, original count being $original_count and current count is $curr_count"
   32         }
   33 }