You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like to use Filet for tests, to create temporary structures. I use the examples from your readme. Today I started running my tests in parallal (t.Parallel()), and had weird issues. It appears Filet does not support parallel testing...
So we have a trivially simple TmpDir being created and cleaned up, and have to test functions doing that. (It is important that we have at least two functions, since one function is never run in parallel with itself!)
When running the tests, we can control the parallelism:
$ go test -parallel 1 -count 10 main_test.go
ok command-line-arguments 4.023s
$ go test -parallel 2 -count 10 main_test.go
--- FAIL: TestMain2 (0.20s)
main_test.go:27:
Error Trace: main_test.go:27
main_test.go:16
Error: "[/tmp/dir587929604 /tmp/dir894240147]" should have 1 item(s), but has 2
Test: TestMain2
[...]
FAIL
FAIL command-line-arguments 2.021s
FAIL
The text was updated successfully, but these errors were encountered:
We create a new list of files per TestReporter. This needed a map, and
thus some helper functions to help with locking around the map.
This however changes the way you can access the `Files` array. You now
need to access it through the map key (see the README changes)
FixesFlaque#5
Signed-off-by: Jo Vandeginste <[email protected]>
I like to use Filet for tests, to create temporary structures. I use the examples from your readme. Today I started running my tests in parallal (
t.Parallel()
), and had weird issues. It appears Filet does not support parallel testing...Consider the following test file (
main_test.go
):So we have a trivially simple TmpDir being created and cleaned up, and have to test functions doing that. (It is important that we have at least two functions, since one function is never run in parallel with itself!)
When running the tests, we can control the parallelism:
The text was updated successfully, but these errors were encountered: