- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          Add a timeout to the remote-test-client connection
          #147952
        
          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
base: master
Are you sure you want to change the base?
  
    Add a timeout to the remote-test-client connection
  
  #147952
              Conversation
| rustbot has assigned @Mark-Simulacrum. Use  | 
1d1f5fd    to
    799df1c      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I no longer have r+ permissions
| total_dur += dur; | ||
| } | ||
|  | ||
| panic!("Test device at {device_address} timed out"); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be comforting with a test for this. I'm thinking a test where we make the binary connect to non-existing address and use a small timeout and assert on that it panics.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| I'll assign myself to this one for now. r? Enselic | 
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some more things. To avoid confusion for the test later: I would prefer a test that actually invokes the binary rather than having some kind of unit test.
b79af79    to
    7a6c157      
    Compare
  
    
Currently, the
remote-test-clientdoesn't have a timeout when connecting to theremote-test-server. This means that running tests using it can hang indefinitely which causes issues when running tests on CI, for example.This PR now sets a default timeout of 5 minutes, meaning that if, for example,
TEST_DEVICE_ADDR=<IP:PORT> ./x test --target riscv64gc-unknown-linux-gnu tests/uiis run and theremote-test-serveris not reachable by the client, the client will panic after the timeout is reached.Additionally, the
TEST_DEVICE_CONNECT_TIMEOUTenv variable can be used to set up the timeout to any value (in seconds).