summaryrefslogtreecommitdiff
path: root/test/files/jvm/future-spec
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'ad845ff' into merge/2.10.x-to-2.11.x-20150224Jason Zaugg2015-02-241-8/+67
|\ | | | | | | | | | | Conflicts: src/library/scala/concurrent/Promise.scala test/files/jvm/future-spec/PromiseTests.scala
| * SI-8689 Avoid internal error in Promise after sequence of completionsViktor Klang2015-02-041-9/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling `completeWith` when the `DefaultPromise` is already completed, leads to callbacks not being properly executed. This happened because `Future.InternalCallbackExecutor` extends `BatchingExecutor`[1] which assumes `unbatchedExecute` to be async, when in this case it is sync, and if there is an exception thrown by executing the batch, it creates a new batch with the remaining items from the current batch and submits that to `unbatchedExecute` and then rethrows, but if you have a sync `unbatchedExecute`, it will fail since it is not reentrant, as witnessed by the failed `require` as reported in this issue. This commit avoids problem by delegating `completeWith` to `tryComplete`, which has the effect of using `onComplete` + `tryComplete` i.s.o. `complete`, which means that when it fails (because of a benign race condition between completers) it won't throw an exception. It has been tested by the minimized reproducer. [1] Actually, in the 2.10.x branch where this patch is starting out, "The BatchingExecutor trait had to be inlined into InternalCallbackExecutor for binary compatibility.". This comment will be more literally correct in the context of 2.11.x and beyond
* | SI-8035 Deprecate automatic () insertion in argument listsSimon Ochsenreither2014-01-091-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This promotes the () insertion warning from -Ywarn-adapted-args to a deprecation warning. -Xfuture tunrs it into a compiler error. Auto tupling remains unchanged for now. The tests have been fixed the following way: - Warnings caused by general sloppiness (Try(), Future(), ...) have been fixed. - Warnings which raise interesting questions (x == (), ...) received an updated checkfile for now.
* | Merge commit '7d74884' into merge-2.10.x-to-masterJason Zaugg2013-12-061-2/+2
|\| | | | | | | | | Conflicts: test/files/jvm/scala-concurrent-tck.scala
| * SI-6913 Fixing semantics of Future fallbackTo to be according to docsHeather Miller2013-12-051-2/+2
| | | | | | | | Origin: viktorklang@1bbe854
* | SI-7958 Deprecate methods `future` and `promise` in the `scala.concurrent` ↵Philipp Haller2013-11-121-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | package object - The corresponding `apply` methods in the `Future` and `Promise` objects should be used instead. - Adjusted tests to use non-deprecated versions - Fixed doc comments not to use deprecated methods - Added comment about planned removal in 2.13.0
* | Make future-spec tests not spawn threads in constructors.James Iry2013-11-014-6/+6
| | | | | | | | | | | | | | | | | | The future-spec tests were spawning threads in object constructors which meant they were on the ragged edge of entering deadlock from the static initialization lock acquired during the static initialization blocks we use to construct object reference fields. My work on restructuring lambdas pushed it over the edge. This commit refactors the tests to use class constructors rather than object constructors.
* | Cull extraneous whitespace.Paul Phillips2013-09-183-146/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* | SI-7003 Partest redirects stderr to log fileSom Snytt2013-05-251-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some scalac output is on stderr, and it's useful to see that in the log file, especially for debugging. Adds a line filter for logs, specified as "filter: pattern" in the test source. Backslashes are made forward only when detected as paths. Test alignments: Deprecations which do not pertain to the system under test are corrected in the obvious way. When testing deprecated API, suppress warnings by deprecating the Test object. Check files are updated with useful true warnings, instead of running under -nowarn. Language feature imports as required, instead of running under -language. Language feature not required, such as casual use of postfix. Heed useful warning. Ignore broken warnings. (Rarely, -nowarn.) Inliner warnings pop up under -optimise only, so for now, just filter them out where they occur. Debug output from the test required an update.
* | Merge v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-masterJason Zaugg2013-05-171-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ================================================================ Merge commit 'v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala ================================================================ Merge -s ours 4e64a27 ([nomaster commit range]) ================================================================ Merge commit '0ae7e55' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/Macros.scala
| * SI-7164 - Removing NotImplementedError as Fatal from s.u.c.NonFatalViktor Klang2013-02-211-1/+1
| |
* | SI-7383 - Call ExecutionContext.prepare in Future.apply to allow for ↵Viktor Klang2013-05-101-0/+19
|/ | | | capturing local context like ThreadLocals and then re-establishing them prior to execution, as per intention of EC.prepare
* SI-7029 - Make test more robustPhilipp Haller2013-02-011-24/+12
|
* SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH for ↵Viktor Klang2013-01-311-0/+24
| | | | the global ExecutionContext
* move Duration (incl. DSL) into scala.concurrent.duration packageRoland2012-09-193-5/+5
| | | | | | | | | so that the full package can be imported naturally: import scala.concurrent.duration._ will give you all the types (Duration, FiniteDuration, Deadline) and the DSL for constructing these.
* Add missing tests for SI-6190Paolo Giarrusso2012-08-251-1/+13
| | | | | This was silently fixed in commit 3cb0e784a05db7d0b542cec9bf4c5fbf3772a6cf but no test was added.
* Doc fix on exec ctx prepare method, fix to testsHeather Miller2012-08-081-1/+0
|
* Added tests, removal of unnecessary methods, fixes prepareHeather Miller2012-08-071-6/+6
|
* Temporarily skips failing test due to optimizer bug SI-6188Heather Miller2012-08-051-5/+5
| | | | Also swaps the arguments to method transform on Try, so as to mirror transform on scala.concurrent.Future.
* Basing Futures on Try instead of EitherHeather Miller2012-08-044-17/+139
|
* Critical bugfixes/leak fixes/API corrections + ScalaDoc for SIP-14Viktor Klang2012-07-192-6/+9
|
* Collection of updates to SIP-14 (scala.concurrent)Havoc Pennington2012-07-092-65/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developed by Viktor Klang and Havoc Pennington - add Promise.isCompleted - add Future.successful and Future.failed - add ExecutionContextExecutor and ExecutionContextExecutorService for Java interop - remove defaultExecutionContext as default parameter value from promise and future - add ExecutionContext.Implicits.global which must be explicitly imported, rather than the previous always-available value for the implicit EC - remove currentExecutionContext, since it could create bugs by being out of sync with the implicit ExecutionContext - remove Future task batching (_taskStack) and Future.releaseStack This optimization should instead be implemented either in a specific thread pool or in a specific ExecutionContext. Some pools or ExecutionContexts may not want or need it. In this patch, the defaultExecutionContext does not keep the batching optimization. Whether it should have it should perhaps be determined through benchmarking. - move internalBlockingCall to BlockContext and remove currentExecutionContext In this patch, BlockContext must be implemented by Thread.currentThread, so the thread pool is the only place you can add custom hooks to be run when blocking. We implement BlockContext for the default ForkJoinWorkerThread in terms of ForkJoinPool.ManagedBlocker. - add public BlockContext.current and BlockContext.withBlockContext These allow an ExecutionContext or other code to override the BlockContext for the current thread. With this API, the BlockContext is customizable without creating a new pool of threads. BlockContext.current is needed to obtain the previous BlockContext before you push, so you can "chain up" to it if desired. BlockContext.withBlockContext is used to override the context for a given piece of code. - move isFutureThrowable into impl.Future - add implicitNotFound to ExecutionContext - remove default global EC from future {} and promise {} - add ExecutionContext.global for explicit use of the global default EC, replaces defaultExecutionContext - add a timeout to scala-concurrent-tck tests that block on SyncVar (so tests time out rather than hang) - insert blocking{} calls into concurrent tck to fix deadlocking - add NonFatal.apply and tests for NonFatal - add OnCompleteRunnable marker trait This would allow an ExecutionContext to distinguish a Runnable originating from Future.onComplete (all callbacks on Future end up going through onComplete). - rename ListenerRunnable to CallbackRunnable and use for KeptPromise too Just adds some clarity and consistency.
* SIP-14: clean ups and fixesphaller2012-05-172-2/+2
|
* Widen types in signatures of Future companion methods, refactor ↵Aleksandar Prokopec2012-05-012-238/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | OnceCanBuildFrom. Removed the implicit modifier on the OnceCanBuildFrom, as we don't support implicit classes with zero arguments. Added an implicit OnceCanBuildFrom method. The idea behind OnceCanBuildFrom is for it to be used by methods which construct collections, but are defined outside of collection classes. OnceCanBuildFrom so far worked only for objects of type TraversableOnce: shuffle(List(1, 2, 3).iterator: TraversableOnce[Int]) but this used to result in an implicit resolution error: shuffle(List(1, 2, 3).iterator) because after the type parameter M for `shuffle` was inferred to Iterator, no implicit of type CanBuildFrom[Iterator[_], A, Iterator[A]] could be found. Introduced another CanBuildFrom to the Iterator companion object. Modified Future tests appropriately.
* Add promises tests.Aleksandar Prokopec2012-04-302-0/+227
|
* Fixed a bug with setting execution contexts.Aleksandar Prokopec2012-04-301-2/+138
| | | | Ported most of the future tests.
* Porting akka future tests.Aleksandar Prokopec2012-04-272-0/+471
Fixed a bug in Future.zip.