-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: reset ready timeout on successful connection #160
Conversation
Main issues are fixed. Working on how we might leverage the extension test api to test different aspects of the duplex stream on the ssh connection provider to shore up some coverage gaps. |
* add sinon types to aid with type safety * refactor contentdataprovider tests to use types * add ts-sinon library to add with stubbing of interfaces
client/src/connection/ssh/index.ts
Outdated
stream?.write(`%put ${endCode};\n`); | ||
}); | ||
} | ||
setTimer() { |
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.
Can we add method private
/protected
/etc to these methods to get a better idea of what's publicly accessible?
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.
Good catch, meant to do this as part of moving the logic into a class definition. Will add these.
* use arrow functions * visibility modifiers on class functions * refactor listeners into discreet methods
Co-authored-by: Scott Dover <scott@scottdover.com>
Co-authored-by: Scott Dover <scott@scottdover.com>
Summary
Correct the connection ready timeout to clear when a successful connection is made. The previous behavior was prematurely closing the ssh session because the timeout was firing even after a successful connection ready event was encountered. In the timeout function there is code to gracefully end the connection.
This behavior resulted in subsequent run button presses resetting/re-establishing the sas -nodms interactive session. When this happened any intermediate work table content was lost.
Testing (Developer)
Test via steps to reproduce:
1. Connect to a 9.4 environment with a SAS 9.4 Remote connection profile.
2. Place the following sas code in the editor contents:
data test; set sashelp.class; run;
3. Click run. Verify that no errors appear in the log.
4. Replace editor contents with code that uses the work table:
proc print data=test; run;
5. Click run.
6. Verify that proc print step from 4 prints the results from the work table to the log.
7. Verify that result tab shows with 19 observations.
8. Click the close button.
9. Replace the editor contents with code from step 4.
10. Click run.
11. Verify that the intermediate work table is no longer found with error:
File WORK.TEST.DATA does not exist.
Test that a sas program that runs for longer than the ready timeout (default 10) seconds value does not prematurely timeout. Program code:
data _null_; slept=sleep(25,1); run;
Add appropriate unit tests