Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Tests create files in test directory rather than tmp dir. #57

Closed
augustoroman opened this issue Aug 21, 2013 · 4 comments
Closed

Tests create files in test directory rather than tmp dir. #57

augustoroman opened this issue Aug 21, 2013 · 4 comments

Comments

@augustoroman
Copy link

If the test is interrupted, subsequent runs may fail because the test directories or files already exist.

The tests should create a unique dir using os.TempDir().

@nathany
Copy link
Contributor

nathany commented Sep 7, 2013

@mitchellh was telling me that fsnotify won't work on shared filesystems, such as used to share code with Vagrant. Another reason to do tests with os.TempDir() -- I'll look into it once I have a reasonable way to run the existing test suite on multiple operating systems.

@mitchellh
Copy link

I agree, or do what the Go standard library does and use os.TempDir() only if some environmental variable isn't set. Then at least you can set an env var to control where test files go.

@nathany
Copy link
Contributor

nathany commented Sep 8, 2013

Specifically the current suite has this error: failed to create test directory: mkdir _test: file exists

@howeyc
Copy link
Owner

howeyc commented Sep 8, 2013

I managed to get this working on Linux/FreeBSD/Windows.

@howeyc howeyc closed this as completed Sep 8, 2013
rsc pushed a commit to golang/exp that referenced this issue Dec 7, 2014
Handle ERROR_MORE_DATA on Windows
(howeyc/fsnotify#49)

Run tests in random temp directories
(howeyc/fsnotify#57)

Fix: RemoveWatch is not removing the path from the watch list
The issue was that files watched internally were not being removed
when the parent directory's watch was removed.
(howeyc/fsnotify#71)

Fix: Race on OS X between Close() and readEvents()
(howeyc/fsnotify#70)

Fix: deadlock on BSD
The removeWatch routine could return without releasing the lock on
w.bufmut. This change unlocks the mutex before checking for errors.
(howeyc/fsnotify#77)

Add an IsAttrib method on the FileEvent struct
(howeyc/fsnotify#79)

Fix: a few typos

Test helpers for shared setup.

LGTM=iant
R=golang-codereviews, dave, alex.brainman, gobot, bradfitz, iant
CC=bradfitz, bronze1man, cespare, denis.brandolini, golang-codereviews, henrik.edwards, jbowtie, travis.cline, webustany
https://golang.org/cl/58500043
actgardner pushed a commit to scalingdata/fsnotify that referenced this issue Apr 2, 2015
setup CircleCI to test on OS X
GoogleCodeExporter pushed a commit to bsed/go-zh.exp that referenced this issue May 31, 2015
Handle ERROR_MORE_DATA on Windows
(howeyc/fsnotify#49)

Run tests in random temp directories
(howeyc/fsnotify#57)

Fix: RemoveWatch is not removing the path from the watch list
The issue was that files watched internally were not being removed
when the parent directory's watch was removed.
(howeyc/fsnotify#71)

Fix: Race on OS X between Close() and readEvents()
(howeyc/fsnotify#70)

Fix: deadlock on BSD
The removeWatch routine could return without releasing the lock on
w.bufmut. This change unlocks the mutex before checking for errors.
(howeyc/fsnotify#77)

Add an IsAttrib method on the FileEvent struct
(howeyc/fsnotify#79)

Fix: a few typos

Test helpers for shared setup.

LGTM=iant
R=golang-codereviews, dave, alex.brainman, gobot, bradfitz, iant
CC=bradfitz, bronze1man, cespare, denis.brandolini, golang-codereviews, henrik.edwards, jbowtie, travis.cline, webustany
https://codereview.appspot.com/58500043

Committer: Ian Lance Taylor <iant@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants