Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modes_spec: "yellow flash affects all signal groups" has a hardcoded timeout of 10 seconds #354

Closed
sveitech opened this issue Nov 30, 2023 · 1 comment

Comments

@sveitech
Copy link

 # Verify that we can yellow flash causes all groups to go to state 'c'
    #
    # 1. Given the site is connected
    # 2. Send the control command to switch to Yellow flash
    # 3. Wait for all groups to go to group 'c'
    # 4. Send command to switch to normal control
    # 5. Wait for all groups to switch do something else that 'c'
    specify 'yellow flash affects all signal groups', sxl: '>=1.0.7' do |example|
      Validator::Site.connected do |task,supervisor,site|
        prepare task, site
        timeout =  10 

        switch_yellow_flash
        wait_for_groups 'c', timeout: timeout      # c mean s yellow flash

        switch_normal_control
        wait_for_groups '[^c]', timeout: timeout   # not c, ie. not yellow flash
      end
    end

This timeout of 10 seconds should be configurable in the config file. The timeout is also hardcoded in the "wait_for_groups" function, even though it is passed as a parameter.

def wait_for_groups state, timeout:
    timeout = 10
    regex = /^#{state}+$/
    wait_for_status(@task,
      "Wait for all groups to go to yellow flash",
      [{'sCI'=>'S0001','n'=>'signalgroupstatus','s'=>regex}],
      update_rate: 0,
      timeout: timeout
    )
  end
@emiltin
Copy link
Contributor

emiltin commented Dec 13, 2023

Fixed with #359

@emiltin emiltin closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants