Compare commits

...

6 Commits

Author SHA1 Message Date
Nicolas Raynaud
8d2bdd62b8 fix tests 2021-02-11 15:33:14 +01:00
Nicolas Raynaud
fffdb774a3 fix tests 2021-02-11 01:14:08 +01:00
Nicolas Raynaud
0659e4d725 merge master 2021-02-10 23:45:57 +01:00
Nicolas Raynaud
dce95e875a split PR 2021-02-10 23:42:47 +01:00
Nicolas Raynaud
ae94a512d9 add test 2021-02-10 21:04:10 +01:00
Nicolas Raynaud
b6d3253d33 fix local._closeFile() 2021-02-10 14:26:00 +01:00
6 changed files with 11 additions and 4 deletions

View File

@@ -376,7 +376,7 @@ export default class RemoteHandlerAbstract {
// Methods that can be called by private methods to avoid parallel limit on public methods
async __closeFile(fd: FileDescriptor): Promise<void> {
await timeout.call(this._closeFile(fd.fd), this._timeout)
await timeout.call(this._closeFile(fd), this._timeout)
}
async __mkdir(dir: string, { mode }: { mode?: number } = {}): Promise<void> {

View File

@@ -348,5 +348,11 @@ handlers.forEach(url => {
}
)
})
describe('#open()', () => {
it('can do an open/close cycle without crashing', async () => {
const file = await handler.openFile('write', 'w')
expect(async () => handler.closeFile(file)).not.toThrow()
})
})
})
})

View File

@@ -18,7 +18,7 @@ export default class LocalHandler extends RemoteHandlerAbstract {
}
async _closeFile(fd) {
return fs.close(fd)
return fs.close(fd.fd)
}
async _createReadStream(file, options) {

View File

@@ -35,6 +35,7 @@
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- @xen-orchestra/fs patch
- xen-api patch
- xo-common minor
- xo-server minor

View File

@@ -13,7 +13,7 @@ import { randomBytes } from 'crypto'
import Vhd, { chainVhd, createSyntheticStream, mergeVhd as vhdMerge } from './'
import { SECTOR_SIZE } from './src/_constants'
import { SECTOR_SIZE } from './_constants'
let tempDir = null

View File

@@ -8,7 +8,7 @@ import { pipeline } from 'readable-stream'
import { createReadableRawStream, createReadableSparseStream } from './'
import { createFooter } from './src/_createFooterHeader'
import { createFooter } from './_createFooterHeader'
let tempDir = null