Skip to content

Make known-host file to tolerate duplicated serverId #111

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

Closed
wants to merge 2 commits into from

Conversation

zhenlineo
Copy link
Contributor

If there is more than one dup in the known-host file, then the first one will be picked.
Based on #110

Stefan-Gabriel Muscalu and others added 2 commits July 22, 2016 15:01
var text = fs.readFileSync(knownHostsPath,'utf8');
fs.writeFileSync(knownHostsPath, text+text);
}, 1000);

// When
driver.session().run("RETURN true AS a").then( function(data) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be encapsulated in a setTimeout(2000) in order to wait for the above one to duplicate the file data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test passed on test server. So maybe the timeout is okay? Though currently we just tested on linux, our windows test server might require longer to see the change. Currently the test failed at a known tck failing test :D I am trying to fix it now so get this PR ready.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but since driver.session().run() will fire off the queue at an arbitrary time, you cannot know if the file has been modified to have duplicated lines yet.

@zhenlineo zhenlineo closed this Jul 26, 2016
@zhenlineo zhenlineo deleted the 1.0-known-host-file-dup branch July 26, 2016 11:36
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

Successfully merging this pull request may close these issues.

2 participants