Skip to content

Commit

Permalink
add timeout arg
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Jan 15, 2024
1 parent 33913a9 commit aad0af9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fullstack-network-manager/src/core/kubectl2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as sb from 'stream-buffers'

/**
* A kubectl wrapper class providing custom functionalities required by fsnetman
*
* This class isn't threadsafe
*/
export class Kubectl2 {
constructor () {
Expand Down Expand Up @@ -289,9 +291,10 @@ export class Kubectl2 {
* @param podName pod name
* @param containerName container name
* @param destPath path inside the container
* @param timeout timeout in ms
* @return {Promise<{}>}
*/
async listDir (podName, containerName, destPath) {
async listDir (podName, containerName, destPath, timeout = 5000) {
try {
// verify that file is copied correctly
const self = this
Expand Down Expand Up @@ -335,7 +338,7 @@ export class Kubectl2 {
clearInterval(timerId)
reject(new FullstackTestingError(`timeout occurred while checking path: ${destPath}`))
}
}, 5000)
}, timeout)
})
} catch (e) {

Expand Down

0 comments on commit aad0af9

Please sign in to comment.