mirror of
https://github.com/fuse-friends/fuse-native
synced 2024-10-27 18:34:01 +00:00
try to fix flaky tests on ancient osx
This commit is contained in:
parent
3d9dd1945e
commit
6ce141d308
6
test/helpers/index.js
Normal file
6
test/helpers/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
exports.unmount = function (fuse, cb) { // This only seems to be nessesary an the ancient osx we use on travis so ... yolo
|
||||||
|
fuse.unmount(function (err) {
|
||||||
|
if (err) return cb(err)
|
||||||
|
setTimeout(cb, 1000)
|
||||||
|
})
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
const tape = require('tape')
|
const tape = require('tape')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const { unmount } = require('./helpers')
|
||||||
|
|
||||||
const Fuse = require('../')
|
const Fuse = require('../')
|
||||||
const mnt = require('./fixtures/mnt')
|
const mnt = require('./fixtures/mnt')
|
||||||
@ -53,7 +54,7 @@ tape('readlink', function (t) {
|
|||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
t.same(buf, Buffer.from('hello world'), 'can read link content')
|
t.same(buf, Buffer.from('hello world'), 'can read link content')
|
||||||
|
|
||||||
fuse.unmount(function () {
|
unmount(fuse, function () {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
15
test/misc.js
15
test/misc.js
@ -1,14 +1,15 @@
|
|||||||
var mnt = require('./fixtures/mnt')
|
const mnt = require('./fixtures/mnt')
|
||||||
var tape = require('tape')
|
const tape = require('tape')
|
||||||
|
|
||||||
var Fuse = require('../')
|
const Fuse = require('../')
|
||||||
|
const { unmount } = require('./helpers')
|
||||||
|
|
||||||
tape('mount', function (t) {
|
tape('mount', function (t) {
|
||||||
const fuse = new Fuse(mnt, {}, { force: true })
|
const fuse = new Fuse(mnt, {}, { force: true })
|
||||||
fuse.mount(function (err) {
|
fuse.mount(function (err) {
|
||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
t.ok(true, 'works')
|
t.ok(true, 'works')
|
||||||
fuse.unmount(function () {
|
unmount(fuse, function () {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -21,11 +22,11 @@ tape('mount + unmount + mount', function (t) {
|
|||||||
fuse1.mount(function (err) {
|
fuse1.mount(function (err) {
|
||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
t.ok(true, 'works')
|
t.ok(true, 'works')
|
||||||
fuse1.unmount(function () {
|
unmount(fuse1, function () {
|
||||||
fuse2.mount(function (err) {
|
fuse2.mount(function (err) {
|
||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
t.ok(true, 'works')
|
t.ok(true, 'works')
|
||||||
fuse2.unmount(function () {
|
unmount(fuse2, function () {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -39,7 +40,7 @@ tape('mount + unmount + mount with same instance fails', function (t) {
|
|||||||
fuse.mount(function (err) {
|
fuse.mount(function (err) {
|
||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
t.ok(true, 'works')
|
t.ok(true, 'works')
|
||||||
fuse.unmount(function () {
|
unmount(fuse, function () {
|
||||||
fuse.mount(function (err) {
|
fuse.mount(function (err) {
|
||||||
t.ok(err, 'had error')
|
t.ok(err, 'had error')
|
||||||
t.end()
|
t.end()
|
||||||
|
@ -6,6 +6,7 @@ const concat = require('concat-stream')
|
|||||||
const Fuse = require('../')
|
const Fuse = require('../')
|
||||||
const mnt = require('./fixtures/mnt')
|
const mnt = require('./fixtures/mnt')
|
||||||
const stat = require('./fixtures/stat')
|
const stat = require('./fixtures/stat')
|
||||||
|
const { unmount } = require('./helpers')
|
||||||
|
|
||||||
tape('read', function (t) {
|
tape('read', function (t) {
|
||||||
var ops = {
|
var ops = {
|
||||||
@ -23,7 +24,6 @@ tape('read', function (t) {
|
|||||||
return process.nextTick(cb, 0, 42)
|
return process.nextTick(cb, 0, 42)
|
||||||
},
|
},
|
||||||
release: function (path, fd, cb) {
|
release: function (path, fd, cb) {
|
||||||
console.log('IN JS RELEASE')
|
|
||||||
t.same(fd, 42, 'fd was passed to release')
|
t.same(fd, 42, 'fd was passed to release')
|
||||||
return process.nextTick(cb, 0)
|
return process.nextTick(cb, 0)
|
||||||
},
|
},
|
||||||
@ -53,7 +53,7 @@ tape('read', function (t) {
|
|||||||
fs.createReadStream(path.join(mnt, 'test'), { start: 6, end: 10 }).pipe(concat(function (buf) {
|
fs.createReadStream(path.join(mnt, 'test'), { start: 6, end: 10 }).pipe(concat(function (buf) {
|
||||||
t.same(buf, Buffer.from('world'), 'partial read file + start offset')
|
t.same(buf, Buffer.from('world'), 'partial read file + start offset')
|
||||||
|
|
||||||
fuse.unmount(function () {
|
unmount(fuse, function () {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
const { exec } = require('child_process')
|
const { exec } = require('child_process')
|
||||||
var tape = require('tape')
|
const { unmount } = require('./helpers')
|
||||||
|
const tape = require('tape')
|
||||||
|
|
||||||
var Fuse = require('../')
|
const Fuse = require('../')
|
||||||
const mnt = require('./fixtures/mnt')
|
const mnt = require('./fixtures/mnt')
|
||||||
const stat = require('./fixtures/stat')
|
const stat = require('./fixtures/stat')
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ tape('statfs', function (t) {
|
|||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
exec(`df ${mnt}`, (err) => {
|
exec(`df ${mnt}`, (err) => {
|
||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
fuse.unmount(function () {
|
unmount(fuse, function () {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -5,6 +5,7 @@ const path = require('path')
|
|||||||
const Fuse = require('../')
|
const Fuse = require('../')
|
||||||
const mnt = require('./fixtures/mnt')
|
const mnt = require('./fixtures/mnt')
|
||||||
const stat = require('./fixtures/stat')
|
const stat = require('./fixtures/stat')
|
||||||
|
const { unmount } = require('./helpers')
|
||||||
|
|
||||||
tape('write', function (t) {
|
tape('write', function (t) {
|
||||||
var created = false
|
var created = false
|
||||||
@ -48,7 +49,7 @@ tape('write', function (t) {
|
|||||||
t.error(err, 'no error')
|
t.error(err, 'no error')
|
||||||
t.same(data.slice(0, size), Buffer.from('hello world'), 'data was written')
|
t.same(data.slice(0, size), Buffer.from('hello world'), 'data was written')
|
||||||
|
|
||||||
fuse.unmount(function () {
|
unmount(fuse, function () {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user