File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,20 @@ addprocs(2)
150
150
MyPackageTests. runtests ()
151
151
```
152
152
153
+ !!! note
154
+
155
+ As was already mentioned, testset-for iterators are evaluated at load time in
156
+ the enclosing module, but this currently happens only in the main process.
157
+ This can lead to unexpected errors when the package was written without a
158
+ `Distributed` use-case in mind.
159
+
160
+ For example, say the package defines a constant singleton object `X` which is
161
+ normally equal to itself (because `X === X`). But if `X` is assigned to a
162
+ testset-for loop variable `x`, it will be the one from the main process, so
163
+ within the testset-for, a test like `x == X` might fail because `X` refers to
164
+ the singleton object defined in another process; a solution in this case could
165
+ be to define explicitly `==` for objects of the type of `X`.
166
+
153
167
It should be relatively easy to support threaded execution of testsets (it was
154
168
actually implemented at one point). But it often happens that compiling
155
169
package code and testset code (which currently is not threaded) takes quite
You can’t perform that action at this time.
0 commit comments