Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Is this "IllegalStateException: This job has not completed yet" while using runBlockingTest normal? #1222

Closed
sum-elier opened this issue May 25, 2019 · 22 comments
Assignees
Labels

Comments

@sum-elier
Copy link

@sum-elier sum-elier commented May 25, 2019

Why when executing the following test:

@Test
fun foo() = runBlockingTest {
  bar()
}

suspend fun bar() {
  println(1)
  withContext(Dispatchers.IO) {
	 println(2)
  }
  println(3)
}

The output is:

1
2
3

java.lang.IllegalStateException: This job has not completed yet

	at kotlinx.coroutines.JobSupport.getCompletionExceptionOrNull(JobSupport.kt:1114)
	at kotlinx.coroutines.test.TestBuildersKt.runBlockingTest(TestBuilders.kt:53)
	at kotlinx.coroutines.test.TestBuildersKt.runBlockingTest$default(TestBuilders.kt:45)
	at com.foopkg.MyTests.foo(MyTests.kt:11)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:628)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:117)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:184)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:180)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:127)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at java.util.ArrayList.forEach(ArrayList.java:1251)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at java.util.ArrayList.forEach(ArrayList.java:1251)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:74)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Is it related to #1204 ?

@sum-elier sum-elier changed the title [question] Is this "IllegalStateException: This job has not completed yet" normal? [question] Is this "IllegalStateException: This job has not completed yet" while using runBlockingTest normal? May 26, 2019
@voghDev
Copy link

@voghDev voghDev commented May 27, 2019

I'm having the same problem. I'll paste the Test I'm running here, for if it helps

Test (NewsPresenterTest.kt)

@Test
fun `should load first page of news on start`() = runBlockingTest {
    givenThereAreNoNews()

    presenter.initialize()

    verify(mockNewsRepository).getNews(eq(1), anyLong())
}

Production code (NewsPresenter.kt)

override suspend fun initialize() {
    val result = coroutine { newsRepository.getNews(page) }

    // do more stuff with the result...
}

suspend fun <T> coroutine(
    context: CoroutineContext = Dispatchers.IO,
    block: suspend CoroutineScope.() -> T
): T = withContext(context, block)

Expected: Green, run successfully
Output: java.lang.IllegalStateException: This job has not completed yet

[Update] I've noticed that replacing Dispatchers.IO with Dispatchers.Main makes the Test go green. It only fails when using Dispatchers.IO Context

I'm sorry I can't post it to a public GitHub repository :-( I can post any additional code that might be necessary for diagnosing this

@elizarov
Copy link
Member

@elizarov elizarov commented May 27, 2019

cc @objcode

@objcode
Copy link
Contributor

@objcode objcode commented May 27, 2019

Thanks for the minimal repro!

In the current version there's an issue that causes runBlockingTest to throw this exception incorrectly when there are multiple threads. This is the same issue reported in #1204

Patch #1206 will change this to pass as expected.

@mkobit
Copy link
Contributor

@mkobit mkobit commented Aug 19, 2019

Been running this with ktor-client tests as well - is the best workaround for now to just use runBlocking (if you don't entirely need all the APIs and support from runBlockingTest)?

@LypchenkoS
Copy link

@LypchenkoS LypchenkoS commented Sep 6, 2019

I replaced runBlockingTest on runBlocking and it helped.

@fireb86
Copy link

@fireb86 fireb86 commented Sep 10, 2019

I replaced runBlockingTest on runBlocking and it helped.

runBlocking works for me too

private val testDispatcher = TestCoroutineDispatcher()

@Before
fun setup() {
	Dispatchers.setMain(testDispatcher)
}

@After
fun cleanUp() {
	Dispatchers.resetMain()
	testDispatcher.cleanupTestCoroutines()
}

@Test
fun testCoroutines1() = runBlocking {
	withContext(Dispatchers.Main) {
		Assert.assertEquals(job1().await() and job2().await(), false)
	}
}

@Test
fun testCoroutines2() = runBlocking {
	withContext(Dispatchers.Main) {
		Assert.assertEquals(job1().await() or job2().await(), true)
	}
}

suspend fun job1() = GlobalScope.async(Dispatchers.Default) {
	delay(1000)
	true
}

suspend fun job2() = GlobalScope.async(Dispatchers.Default) {
	delay(500)
	false
}

@glasser
Copy link
Contributor

@glasser glasser commented Sep 10, 2019

The one annoying thing about runBlocking is that JUnit tests don't run unless they return Unit, but it's hard to remember to always type runBlocking<Unit> or fun testFoo(): Unit = runBlocking`.

We use this just to get around that:

fun testBlocking(test: suspend CoroutineScope.() -> Unit) = runBlocking { test() }

@leandrofnjr
Copy link

@leandrofnjr leandrofnjr commented Jan 22, 2020

Hi,

i'm facing same issue as described above executing my room database unit tests.

Has there been found out any fix for that ?

@nuhkoca
Copy link

@nuhkoca nuhkoca commented Feb 18, 2020

Still continuing. I am using a custom CoroutinesTestRule but still getting this issue. Any workaround except using runBlocking?

jblebrun added a commit to PolymerLabs/arcs that referenced this issue Mar 3, 2020
* Make a simple test lifecycle registry, instead of creating empty
testactivity

* Remove use of `runBlockingTest`: according to
Kotlin/kotlinx.coroutines#1222, if the test
results in coroutines being finished on other threads, it's possible to
receive "This job has not yet completed" exceptions, even though the
jobs were properly terminated. Since we don't need the delay-skipping
properties of `runBlockingTest`, I think it's OK to simply using
`runBlocking`, instead.
jblebrun added a commit to PolymerLabs/arcs that referenced this issue Mar 3, 2020
* Make a simple test lifecycle registry, instead of creating empty
testactivity

* Remove use of `runBlockingTest`: according to
Kotlin/kotlinx.coroutines#1222, if the test
results in coroutines being finished on other threads, it's possible to
receive "This job has not yet completed" exceptions, even though the
jobs were properly terminated. Since we don't need the delay-skipping
properties of `runBlockingTest`, I think it's OK to simply using
`runBlocking`, instead.
jblebrun added a commit to PolymerLabs/arcs that referenced this issue Mar 3, 2020
* Make a simple test lifecycle registry, instead of creating empty
testactivity

* Remove use of `runBlockingTest`: according to
Kotlin/kotlinx.coroutines#1222, if the test
results in coroutines being finished on other threads, it's possible to
receive "This job has not yet completed" exceptions, even though the
jobs were properly terminated. Since we don't need the delay-skipping
properties of `runBlockingTest`, I think it's OK to simply using
`runBlocking`, instead.
jblebrun added a commit to PolymerLabs/arcs that referenced this issue Mar 3, 2020
* Make a simple test lifecycle registry, instead of creating empty
testactivity

* Remove use of `runBlockingTest`: according to
Kotlin/kotlinx.coroutines#1222, if the test
results in coroutines being finished on other threads, it's possible to
receive "This job has not yet completed" exceptions, even though the
jobs were properly terminated. Since we don't need the delay-skipping
properties of `runBlockingTest`, I think it's OK to use `runBlocking`.
jblebrun added a commit to PolymerLabs/arcs that referenced this issue Mar 3, 2020
* Make a simple test lifecycle registry, instead of creating empty
testactivity

* Remove use of `runBlockingTest`: according to
Kotlin/kotlinx.coroutines#1222, if the test
results in coroutines being finished on other threads, it's possible to
receive "This job has not yet completed" exceptions, even though the
jobs were properly terminated. Since we don't need the delay-skipping
properties of `runBlockingTest`, I think it's OK to use `runBlocking`.
jblebrun added a commit to PolymerLabs/arcs that referenced this issue Mar 3, 2020
* Make a simple test lifecycle registry, instead of creating empty
testactivity

* Remove use of `runBlockingTest`: according to
Kotlin/kotlinx.coroutines#1222, if the test
results in coroutines being finished on other threads, it's possible to
receive "This job has not yet completed" exceptions, even though the
jobs were properly terminated. Since we don't need the delay-skipping
properties of `runBlockingTest`, I think it's OK to use `runBlocking`.
jblebrun added a commit to PolymerLabs/arcs that referenced this issue Mar 3, 2020
* Make a simple test lifecycle registry, instead of creating empty
testactivity

* Remove use of `runBlockingTest`: according to
Kotlin/kotlinx.coroutines#1222, if the test
results in coroutines being finished on other threads, it's possible to
receive "This job has not yet completed" exceptions, even though the
jobs were properly terminated. Since we don't need the delay-skipping
properties of `runBlockingTest`, I think it's OK to use `runBlocking`.
alxmrs pushed a commit to alxmrs/arcs that referenced this issue Mar 3, 2020
commit 4b05a28
Merge: f4c1d26 99000c2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:18:14 2020 -0800

    Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

commit f4c1d26
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 99000c2
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 140111f
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:08:12 2020 -0800

    Removed flatMap, added TODOs and link to GH issue

commit 5c6310d
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 11:02:34 2020 -0800

    Simplify service test pattern (PolymerLabs#4817)

    * Make a simple test lifecycle registry, instead of creating empty
    testactivity

    * Remove use of `runBlockingTest`: according to
    Kotlin/kotlinx.coroutines#1222, if the test
    results in coroutines being finished on other threads, it's possible to
    receive "This job has not yet completed" exceptions, even though the
    jobs were properly terminated. Since we don't need the delay-skipping
    properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

commit 472bc84
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:27:56 2020 -0800

    Improved build rules

commit ca1ebf8
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:17:13 2020 -0800

    Impl suggestsions for r2p

commit b5578ea
Author: Jason Feinstein <jwf@google.com>
Date:   Tue Mar 3 09:54:17 2020 -0800

    Add tests for dereferencing references to the HandleManagerTest(s) (PolymerLabs#4816)

    * Add dereferencing tests to the android handle manager test.

    * Add dereferencing tests to core HandleManager.

commit a695797
Author: Jason Feinstein <jwf@google.com>
Date:   Mon Mar 2 18:14:07 2020 -0800

    Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (PolymerLabs#4812)

    * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

    Also: Create ParcelableReference.

    * Add dep. Also, apparently read/writeBoolean is Q-only.

    * Just write null if there is no version map.

    * Just write null if there is no version map.

commit ba7a107
Author: Gogul Balakrishnan <bgogul@google.com>
Date:   Mon Mar 2 17:51:35 2020 -0800

    Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (PolymerLabs#4793)

commit f6df54a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 15:44:32 2020 -0800

    tools/sigh lint

commit bede8d9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:52:02 2020 -0800

    Fixed build rule, simplified runtime

commit 62dcc57
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:38:14 2020 -0800

    Fixed test, added TODO
alxmrs pushed a commit to alxmrs/arcs that referenced this issue Mar 4, 2020
commit b3d92d0
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:17:17 2020 -0800

    updated test name

commit ba7884b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:16:09 2020 -0800

    nested unit tests

commit ef36fdf
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:15:00 2020 -0800

    renamed to tryResolve

commit 5703f02
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:07:18 2020 -0800

    rm generator

commit 658cb1a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:01:54 2020 -0800

    implemented more review suggestions

commit 0056ee3
Merge: cae89c3 0f0f82a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:54:23 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

commit 0f0f82a
Author: Maria Mandlis <mmandlis@chromium.org>
Date:   Wed Mar 4 09:33:29 2020 -0800

    add queryable capability (PolymerLabs#4794)

commit d032c75
Author: Maria Mandlis <mmandlis@chromium.org>
Date:   Wed Mar 4 09:23:07 2020 -0800

    add creatimeTimestamp to entities (kt) (PolymerLabs#4823)

commit 30267fc
Author: jblebrun <jibbl@google.com>
Date:   Wed Mar 4 09:09:39 2020 -0800

    Remove some unused deps (PolymerLabs#4831)

commit c519181
Author: Cameron Silvestrini <csilvestrini@users.noreply.github.com>
Date:   Wed Mar 4 17:14:07 2020 +1100

    Increase size of DatabaseImplTest to medium (PolymerLabs#4827)

    * Increase size of DatabaseImplTest to medium

    Was a bit flaky.

    * Check flakiness

    * Revert presubmit tweak

commit fa621c6
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 22:05:07 2020 -0800

    Fix a race condition when setting up `ServiceStore` message channel (PolymerLabs#4826)

    This seems to be the cause of the flakiness in `AndroidAllocatorTest`
    and `AndroidHandleManagerTest` (PolymerLabs#4781)

commit 78bf4f0
Author: Gogul Balakrishnan <bgogul@google.com>
Date:   Tue Mar 3 18:00:49 2020 -0800

    Utility to convert type proto to field type (if possible). (PolymerLabs#4814)

commit cae89c3
Merge: 0360752 e587539
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 15:50:34 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

commit e587539
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 15:07:16 2020 -0800

    Apply simplified test pattern tests in `arcs.android.host` (PolymerLabs#4821)

    As in 5c6310d

commit 1af1aac
Author: Joshua Pratt <jp10010101010000@gmail.com>
Date:   Wed Mar 4 09:48:15 2020 +1100

    Multinomials (PolymerLabs#4804)

    * multinomial

    * added tests

    * making constant readable again

    * reindent

    * added multivariate rearrangement tests

    * updated comment

    * pr comments:

    Co-authored-by: Ragav Sachdeva <ragavsachdeva007@gmail.com>

commit 0360752
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:42:31 2020 -0800

    fix, bad comparison op

commit 4b05a28
Merge: f4c1d26 99000c2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:18:14 2020 -0800

    Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

commit f4c1d26
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 99000c2
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 140111f
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:08:12 2020 -0800

    Removed flatMap, added TODOs and link to GH issue

commit 5c6310d
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 11:02:34 2020 -0800

    Simplify service test pattern (PolymerLabs#4817)

    * Make a simple test lifecycle registry, instead of creating empty
    testactivity

    * Remove use of `runBlockingTest`: according to
    Kotlin/kotlinx.coroutines#1222, if the test
    results in coroutines being finished on other threads, it's possible to
    receive "This job has not yet completed" exceptions, even though the
    jobs were properly terminated. Since we don't need the delay-skipping
    properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

commit 472bc84
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:27:56 2020 -0800

    Improved build rules

commit ca1ebf8
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:17:13 2020 -0800

    Impl suggestsions for r2p

commit b5578ea
Author: Jason Feinstein <jwf@google.com>
Date:   Tue Mar 3 09:54:17 2020 -0800

    Add tests for dereferencing references to the HandleManagerTest(s) (PolymerLabs#4816)

    * Add dereferencing tests to the android handle manager test.

    * Add dereferencing tests to core HandleManager.

commit a695797
Author: Jason Feinstein <jwf@google.com>
Date:   Mon Mar 2 18:14:07 2020 -0800

    Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (PolymerLabs#4812)

    * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

    Also: Create ParcelableReference.

    * Add dep. Also, apparently read/writeBoolean is Q-only.

    * Just write null if there is no version map.

    * Just write null if there is no version map.

commit ba7a107
Author: Gogul Balakrishnan <bgogul@google.com>
Date:   Mon Mar 2 17:51:35 2020 -0800

    Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (PolymerLabs#4793)

commit f6df54a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 15:44:32 2020 -0800

    tools/sigh lint

commit bede8d9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:52:02 2020 -0800

    Fixed build rule, simplified runtime

commit 62dcc57
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:38:14 2020 -0800

    Fixed test, added TODO
alxmrs added a commit to PolymerLabs/arcs that referenced this issue Mar 4, 2020
* creating structure of ts r2p script

* Created fast CLI rapper for r2p script

* WIP figuring out ways to resolve a recipe

* fix sp

* Passing lint, still WIP

* Build macros for recipe2plan work

* Lightweight iteration on recipe2plan, stubbed out tests

* Revised method to find corresponding create handles

* Added type info

* Added method to get all handles to manifest + get all handles by Id

* fix: no flatMap

* - currently, fails since it cannot find associated stores for handles.

* uncleaned, but working recipe resolution

* Cleaned up for r2p, pt 1

* stubbed out second test (short, short)

* Squashed commit of the following:

commit 62dcc57
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:38:14 2020 -0800

    Fixed test, added TODO

* updates to test, can't get two to fail

* Squashed commit of the following:

commit bede8d9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:52:02 2020 -0800

    Fixed build rule, simplified runtime

commit 62dcc57
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:38:14 2020 -0800

    Fixed test, added TODO

* can't get test to fail... hmm...

* Squashed commit of the following:

commit f6df54a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 15:44:32 2020 -0800

    tools/sigh lint

commit bede8d9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:52:02 2020 -0800

    Fixed build rule, simplified runtime

commit 62dcc57
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:38:14 2020 -0800

    Fixed test, added TODO

* adjusting recipe copying to include triggers

* Revert "adjusting recipe copying to include triggers"

This reverts commit 9bc3734

* four tests complete

* Added test, fixed minor async issue

* Squashed commit of the following:

commit 4b05a28
Merge: f4c1d26 99000c2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:18:14 2020 -0800

    Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

commit f4c1d26
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 99000c2
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 140111f
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:08:12 2020 -0800

    Removed flatMap, added TODOs and link to GH issue

commit 5c6310d
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 11:02:34 2020 -0800

    Simplify service test pattern (#4817)

    * Make a simple test lifecycle registry, instead of creating empty
    testactivity

    * Remove use of `runBlockingTest`: according to
    Kotlin/kotlinx.coroutines#1222, if the test
    results in coroutines being finished on other threads, it's possible to
    receive "This job has not yet completed" exceptions, even though the
    jobs were properly terminated. Since we don't need the delay-skipping
    properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

commit 472bc84
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:27:56 2020 -0800

    Improved build rules

commit ca1ebf8
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:17:13 2020 -0800

    Impl suggestsions for r2p

commit b5578ea
Author: Jason Feinstein <jwf@google.com>
Date:   Tue Mar 3 09:54:17 2020 -0800

    Add tests for dereferencing references to the HandleManagerTest(s) (#4816)

    * Add dereferencing tests to the android handle manager test.

    * Add dereferencing tests to core HandleManager.

commit a695797
Author: Jason Feinstein <jwf@google.com>
Date:   Mon Mar 2 18:14:07 2020 -0800

    Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (#4812)

    * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

    Also: Create ParcelableReference.

    * Add dep. Also, apparently read/writeBoolean is Q-only.

    * Just write null if there is no version map.

    * Just write null if there is no version map.

commit ba7a107
Author: Gogul Balakrishnan <bgogul@google.com>
Date:   Mon Mar 2 17:51:35 2020 -0800

    Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (#4793)

commit f6df54a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 15:44:32 2020 -0800

    tools/sigh lint

commit bede8d9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:52:02 2020 -0800

    Fixed build rule, simplified runtime

commit 62dcc57
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:38:14 2020 -0800

    Fixed test, added TODO

* fix ineq

* existing tests passing

* Updating invalid type test

* Squashed commit of the following:

commit b3d92d0
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:17:17 2020 -0800

    updated test name

commit ba7884b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:16:09 2020 -0800

    nested unit tests

commit ef36fdf
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:15:00 2020 -0800

    renamed to tryResolve

commit 5703f02
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:07:18 2020 -0800

    rm generator

commit 658cb1a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 12:01:54 2020 -0800

    implemented more review suggestions

commit 0056ee3
Merge: cae89c3 0f0f82a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:54:23 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

commit 0f0f82a
Author: Maria Mandlis <mmandlis@chromium.org>
Date:   Wed Mar 4 09:33:29 2020 -0800

    add queryable capability (#4794)

commit d032c75
Author: Maria Mandlis <mmandlis@chromium.org>
Date:   Wed Mar 4 09:23:07 2020 -0800

    add creatimeTimestamp to entities (kt) (#4823)

commit 30267fc
Author: jblebrun <jibbl@google.com>
Date:   Wed Mar 4 09:09:39 2020 -0800

    Remove some unused deps (#4831)

commit c519181
Author: Cameron Silvestrini <csilvestrini@users.noreply.github.com>
Date:   Wed Mar 4 17:14:07 2020 +1100

    Increase size of DatabaseImplTest to medium (#4827)

    * Increase size of DatabaseImplTest to medium

    Was a bit flaky.

    * Check flakiness

    * Revert presubmit tweak

commit fa621c6
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 22:05:07 2020 -0800

    Fix a race condition when setting up `ServiceStore` message channel (#4826)

    This seems to be the cause of the flakiness in `AndroidAllocatorTest`
    and `AndroidHandleManagerTest` (#4781)

commit 78bf4f0
Author: Gogul Balakrishnan <bgogul@google.com>
Date:   Tue Mar 3 18:00:49 2020 -0800

    Utility to convert type proto to field type (if possible). (#4814)

commit cae89c3
Merge: 0360752 e587539
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 15:50:34 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

commit e587539
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 15:07:16 2020 -0800

    Apply simplified test pattern tests in `arcs.android.host` (#4821)

    As in 5c6310d

commit 1af1aac
Author: Joshua Pratt <jp10010101010000@gmail.com>
Date:   Wed Mar 4 09:48:15 2020 +1100

    Multinomials (#4804)

    * multinomial

    * added tests

    * making constant readable again

    * reindent

    * added multivariate rearrangement tests

    * updated comment

    * pr comments:

    Co-authored-by: Ragav Sachdeva <ragavsachdeva007@gmail.com>

commit 0360752
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:42:31 2020 -0800

    fix, bad comparison op

commit 4b05a28
Merge: f4c1d26 99000c2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:18:14 2020 -0800

    Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

commit f4c1d26
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 99000c2
Merge: 140111f 5c6310d
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:14:35 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
    Fixed lint errors

commit 140111f
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 11:08:12 2020 -0800

    Removed flatMap, added TODOs and link to GH issue

commit 5c6310d
Author: jblebrun <jibbl@google.com>
Date:   Tue Mar 3 11:02:34 2020 -0800

    Simplify service test pattern (#4817)

    * Make a simple test lifecycle registry, instead of creating empty
    testactivity

    * Remove use of `runBlockingTest`: according to
    Kotlin/kotlinx.coroutines#1222, if the test
    results in coroutines being finished on other threads, it's possible to
    receive "This job has not yet completed" exceptions, even though the
    jobs were properly terminated. Since we don't need the delay-skipping
    properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

commit 472bc84
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:27:56 2020 -0800

    Improved build rules

commit ca1ebf8
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 10:17:13 2020 -0800

    Impl suggestsions for r2p

commit b5578ea
Author: Jason Feinstein <jwf@google.com>
Date:   Tue Mar 3 09:54:17 2020 -0800

    Add tests for dereferencing references to the HandleManagerTest(s) (#4816)

    * Add dereferencing tests to the android handle manager test.

    * Add dereferencing tests to core HandleManager.

commit a695797
Author: Jason Feinstein <jwf@google.com>
Date:   Mon Mar 2 18:14:07 2020 -0800

    Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (#4812)

    * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

    Also: Create ParcelableReference.

    * Add dep. Also, apparently read/writeBoolean is Q-only.

    * Just write null if there is no version map.

    * Just write null if there is no version map.

commit ba7a107
Author: Gogul Balakrishnan <bgogul@google.com>
Date:   Mon Mar 2 17:51:35 2020 -0800

    Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (#4793)

commit f6df54a
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 15:44:32 2020 -0800

    tools/sigh lint

commit bede8d9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:52:02 2020 -0800

    Fixed build rule, simplified runtime

commit 62dcc57
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Mon Mar 2 14:38:14 2020 -0800

    Fixed test, added TODO

* fixed nested tests

* rewording, reorganizing

* assert more ergonomic
alxmrs pushed a commit to alxmrs/arcs that referenced this issue Mar 5, 2020
commit 17a2ab1
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 16:30:45 2020 -0800

    Fixed indentation

commit 9094055
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 16:03:51 2020 -0800

    revising from feedback

commit d350821
Merge: 9054c23 3acb7e7
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:56:55 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

commit 3acb7e7
Author: Alex Rosengarten <alxr@google.com>
Date:   Wed Mar 4 15:56:42 2020 -0800

    XXS CL to add a hash field to the Schema proto (PolymerLabs#4752)

commit 9054c23
Merge: d15008e 337b7b2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:55:27 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

commit 337b7b2
Author: Alex Rosengarten <alxr@google.com>
Date:   Wed Mar 4 15:55:06 2020 -0800

    recipe2plan 2/n: Validate Handles, Tests (PolymerLabs#4834)

    * creating structure of ts r2p script

    * Created fast CLI rapper for r2p script

    * WIP figuring out ways to resolve a recipe

    * fix sp

    * Passing lint, still WIP

    * Build macros for recipe2plan work

    * Lightweight iteration on recipe2plan, stubbed out tests

    * Revised method to find corresponding create handles

    * Added type info

    * Added method to get all handles to manifest + get all handles by Id

    * fix: no flatMap

    * - currently, fails since it cannot find associated stores for handles.

    * uncleaned, but working recipe resolution

    * Cleaned up for r2p, pt 1

    * stubbed out second test (short, short)

    * Squashed commit of the following:

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * updates to test, can't get two to fail

    * Squashed commit of the following:

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * can't get test to fail... hmm...

    * Squashed commit of the following:

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * adjusting recipe copying to include triggers

    * Revert "adjusting recipe copying to include triggers"

    This reverts commit 9bc3734

    * four tests complete

    * Added test, fixed minor async issue

    * Squashed commit of the following:

    commit 4b05a28
    Merge: f4c1d26 99000c2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:18:14 2020 -0800

        Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

    commit f4c1d26
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 99000c2
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 140111f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:08:12 2020 -0800

        Removed flatMap, added TODOs and link to GH issue

    commit 5c6310d
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 11:02:34 2020 -0800

        Simplify service test pattern (PolymerLabs#4817)

        * Make a simple test lifecycle registry, instead of creating empty
        testactivity

        * Remove use of `runBlockingTest`: according to
        Kotlin/kotlinx.coroutines#1222, if the test
        results in coroutines being finished on other threads, it's possible to
        receive "This job has not yet completed" exceptions, even though the
        jobs were properly terminated. Since we don't need the delay-skipping
        properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

    commit 472bc84
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:27:56 2020 -0800

        Improved build rules

    commit ca1ebf8
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:17:13 2020 -0800

        Impl suggestsions for r2p

    commit b5578ea
    Author: Jason Feinstein <jwf@google.com>
    Date:   Tue Mar 3 09:54:17 2020 -0800

        Add tests for dereferencing references to the HandleManagerTest(s) (PolymerLabs#4816)

        * Add dereferencing tests to the android handle manager test.

        * Add dereferencing tests to core HandleManager.

    commit a695797
    Author: Jason Feinstein <jwf@google.com>
    Date:   Mon Mar 2 18:14:07 2020 -0800

        Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (PolymerLabs#4812)

        * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

        Also: Create ParcelableReference.

        * Add dep. Also, apparently read/writeBoolean is Q-only.

        * Just write null if there is no version map.

        * Just write null if there is no version map.

    commit ba7a107
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Mon Mar 2 17:51:35 2020 -0800

        Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (PolymerLabs#4793)

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * fix ineq

    * existing tests passing

    * Updating invalid type test

    * Squashed commit of the following:

    commit b3d92d0
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:17:17 2020 -0800

        updated test name

    commit ba7884b
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:16:09 2020 -0800

        nested unit tests

    commit ef36fdf
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:15:00 2020 -0800

        renamed to tryResolve

    commit 5703f02
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:07:18 2020 -0800

        rm generator

    commit 658cb1a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:01:54 2020 -0800

        implemented more review suggestions

    commit 0056ee3
    Merge: cae89c3 0f0f82a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:54:23 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

    commit 0f0f82a
    Author: Maria Mandlis <mmandlis@chromium.org>
    Date:   Wed Mar 4 09:33:29 2020 -0800

        add queryable capability (PolymerLabs#4794)

    commit d032c75
    Author: Maria Mandlis <mmandlis@chromium.org>
    Date:   Wed Mar 4 09:23:07 2020 -0800

        add creatimeTimestamp to entities (kt) (PolymerLabs#4823)

    commit 30267fc
    Author: jblebrun <jibbl@google.com>
    Date:   Wed Mar 4 09:09:39 2020 -0800

        Remove some unused deps (PolymerLabs#4831)

    commit c519181
    Author: Cameron Silvestrini <csilvestrini@users.noreply.github.com>
    Date:   Wed Mar 4 17:14:07 2020 +1100

        Increase size of DatabaseImplTest to medium (PolymerLabs#4827)

        * Increase size of DatabaseImplTest to medium

        Was a bit flaky.

        * Check flakiness

        * Revert presubmit tweak

    commit fa621c6
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 22:05:07 2020 -0800

        Fix a race condition when setting up `ServiceStore` message channel (PolymerLabs#4826)

        This seems to be the cause of the flakiness in `AndroidAllocatorTest`
        and `AndroidHandleManagerTest` (PolymerLabs#4781)

    commit 78bf4f0
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Tue Mar 3 18:00:49 2020 -0800

        Utility to convert type proto to field type (if possible). (PolymerLabs#4814)

    commit cae89c3
    Merge: 0360752 e587539
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 15:50:34 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

    commit e587539
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 15:07:16 2020 -0800

        Apply simplified test pattern tests in `arcs.android.host` (PolymerLabs#4821)

        As in 5c6310d

    commit 1af1aac
    Author: Joshua Pratt <jp10010101010000@gmail.com>
    Date:   Wed Mar 4 09:48:15 2020 +1100

        Multinomials (PolymerLabs#4804)

        * multinomial

        * added tests

        * making constant readable again

        * reindent

        * added multivariate rearrangement tests

        * updated comment

        * pr comments:

        Co-authored-by: Ragav Sachdeva <ragavsachdeva007@gmail.com>

    commit 0360752
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:42:31 2020 -0800

        fix, bad comparison op

    commit 4b05a28
    Merge: f4c1d26 99000c2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:18:14 2020 -0800

        Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

    commit f4c1d26
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 99000c2
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 140111f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:08:12 2020 -0800

        Removed flatMap, added TODOs and link to GH issue

    commit 5c6310d
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 11:02:34 2020 -0800

        Simplify service test pattern (PolymerLabs#4817)

        * Make a simple test lifecycle registry, instead of creating empty
        testactivity

        * Remove use of `runBlockingTest`: according to
        Kotlin/kotlinx.coroutines#1222, if the test
        results in coroutines being finished on other threads, it's possible to
        receive "This job has not yet completed" exceptions, even though the
        jobs were properly terminated. Since we don't need the delay-skipping
        properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

    commit 472bc84
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:27:56 2020 -0800

        Improved build rules

    commit ca1ebf8
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:17:13 2020 -0800

        Impl suggestsions for r2p

    commit b5578ea
    Author: Jason Feinstein <jwf@google.com>
    Date:   Tue Mar 3 09:54:17 2020 -0800

        Add tests for dereferencing references to the HandleManagerTest(s) (PolymerLabs#4816)

        * Add dereferencing tests to the android handle manager test.

        * Add dereferencing tests to core HandleManager.

    commit a695797
    Author: Jason Feinstein <jwf@google.com>
    Date:   Mon Mar 2 18:14:07 2020 -0800

        Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (PolymerLabs#4812)

        * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

        Also: Create ParcelableReference.

        * Add dep. Also, apparently read/writeBoolean is Q-only.

        * Just write null if there is no version map.

        * Just write null if there is no version map.

    commit ba7a107
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Mon Mar 2 17:51:35 2020 -0800

        Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (PolymerLabs#4793)

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * fixed nested tests

    * rewording, reorganizing

    * assert more ergonomic

commit 298fdcc
Author: Maria Mandlis <mmandlis@chromium.org>
Date:   Wed Mar 4 15:29:37 2020 -0800

    update wasm readme (PolymerLabs#4832)

commit d15008e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:11:14 2020 -0800

    fixed build

commit bbfc3d2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:04:11 2020 -0800

    EntitySpec Interface can return a schema

commit 3b75c34
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 14:09:36 2020 -0800

    ktlint fix

commit 506457e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 13:59:46 2020 -0800

    addField arguments are more ergonomic

commit 579b2e6
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 13:45:28 2020 -0800

    grooming schema registry

commit 3cb8023
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:39:30 2020 -0800

    rm unused field

commit 1cff99f
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:38:32 2020 -0800

    rm import

commit 855401c
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:31:14 2020 -0800

    no difference w/ wasm golden

commit 552e9ad
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:26:43 2020 -0800

    Added test for mapOf

commit 1430907
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:07:15 2020 -0800

    sigh lint

commit 9c22195
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:06:50 2020 -0800

    minor adjustments

commit 74ae770
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:58:20 2020 -0800

    Improved shape of registry

commit f69f99b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:32:31 2020 -0800

    excluding wasm from generation

commit dcefb16
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:13:46 2020 -0800

    Generation adds to schema registry

commit f3b9ae5
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 07:57:15 2020 -0800

    packaging in a schema registry

commit 2ce6da2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 22:30:39 2020 -0800

    First iteration of schema gen on entities
alxmrs added a commit to PolymerLabs/arcs that referenced this issue Mar 9, 2020
## Summary
First iteration of generating Plan objects.

## Changelog
* creating structure of ts r2p script

* Created fast CLI rapper for r2p script

* WIP figuring out ways to resolve a recipe

* fix sp

* Passing lint, still WIP

* Build macros for recipe2plan work

* Lightweight iteration on recipe2plan, stubbed out tests

* Revised method to find corresponding create handles

* Added type info

* Added method to get all handles to manifest + get all handles by Id

* fix: no flatMap

* - currently, fails since it cannot find associated stores for handles.

* uncleaned, but working recipe resolution

* Cleaned up for r2p, pt 1

* Fixed test, added TODO

* Fixed build rule, simplified runtime

* tools/sigh lint

* Impl suggestsions for r2p

* Improved build rules

* Removed flatMap, added TODOs and link to GH issue

* fix, bad comparison op

* Stub plan generator works

* updated macro to take a package

* Testing import is conditional on package

* Incremental improvement

* tidying

* Fixed tests

* added particle creation method

* flushing out more of plan gen

* Squashed commit of the following:

commit 17a2ab1
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 16:30:45 2020 -0800

    Fixed indentation

commit 9094055
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 16:03:51 2020 -0800

    revising from feedback

commit d350821
Merge: 9054c23 3acb7e7
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:56:55 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

commit 3acb7e7
Author: Alex Rosengarten <alxr@google.com>
Date:   Wed Mar 4 15:56:42 2020 -0800

    XXS CL to add a hash field to the Schema proto (#4752)

commit 9054c23
Merge: d15008e 337b7b2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:55:27 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

commit 337b7b2
Author: Alex Rosengarten <alxr@google.com>
Date:   Wed Mar 4 15:55:06 2020 -0800

    recipe2plan 2/n: Validate Handles, Tests (#4834)

    * creating structure of ts r2p script

    * Created fast CLI rapper for r2p script

    * WIP figuring out ways to resolve a recipe

    * fix sp

    * Passing lint, still WIP

    * Build macros for recipe2plan work

    * Lightweight iteration on recipe2plan, stubbed out tests

    * Revised method to find corresponding create handles

    * Added type info

    * Added method to get all handles to manifest + get all handles by Id

    * fix: no flatMap

    * - currently, fails since it cannot find associated stores for handles.

    * uncleaned, but working recipe resolution

    * Cleaned up for r2p, pt 1

    * stubbed out second test (short, short)

    * Squashed commit of the following:

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * updates to test, can't get two to fail

    * Squashed commit of the following:

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * can't get test to fail... hmm...

    * Squashed commit of the following:

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * adjusting recipe copying to include triggers

    * Revert "adjusting recipe copying to include triggers"

    This reverts commit 9bc3734

    * four tests complete

    * Added test, fixed minor async issue

    * Squashed commit of the following:

    commit 4b05a28
    Merge: f4c1d26 99000c2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:18:14 2020 -0800

        Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

    commit f4c1d26
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 99000c2
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 140111f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:08:12 2020 -0800

        Removed flatMap, added TODOs and link to GH issue

    commit 5c6310d
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 11:02:34 2020 -0800

        Simplify service test pattern (#4817)

        * Make a simple test lifecycle registry, instead of creating empty
        testactivity

        * Remove use of `runBlockingTest`: according to
        Kotlin/kotlinx.coroutines#1222, if the test
        results in coroutines being finished on other threads, it's possible to
        receive "This job has not yet completed" exceptions, even though the
        jobs were properly terminated. Since we don't need the delay-skipping
        properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

    commit 472bc84
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:27:56 2020 -0800

        Improved build rules

    commit ca1ebf8
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:17:13 2020 -0800

        Impl suggestsions for r2p

    commit b5578ea
    Author: Jason Feinstein <jwf@google.com>
    Date:   Tue Mar 3 09:54:17 2020 -0800

        Add tests for dereferencing references to the HandleManagerTest(s) (#4816)

        * Add dereferencing tests to the android handle manager test.

        * Add dereferencing tests to core HandleManager.

    commit a695797
    Author: Jason Feinstein <jwf@google.com>
    Date:   Mon Mar 2 18:14:07 2020 -0800

        Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (#4812)

        * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

        Also: Create ParcelableReference.

        * Add dep. Also, apparently read/writeBoolean is Q-only.

        * Just write null if there is no version map.

        * Just write null if there is no version map.

    commit ba7a107
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Mon Mar 2 17:51:35 2020 -0800

        Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (#4793)

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * fix ineq

    * existing tests passing

    * Updating invalid type test

    * Squashed commit of the following:

    commit b3d92d0
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:17:17 2020 -0800

        updated test name

    commit ba7884b
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:16:09 2020 -0800

        nested unit tests

    commit ef36fdf
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:15:00 2020 -0800

        renamed to tryResolve

    commit 5703f02
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:07:18 2020 -0800

        rm generator

    commit 658cb1a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:01:54 2020 -0800

        implemented more review suggestions

    commit 0056ee3
    Merge: cae89c3 0f0f82a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:54:23 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

    commit 0f0f82a
    Author: Maria Mandlis <mmandlis@chromium.org>
    Date:   Wed Mar 4 09:33:29 2020 -0800

        add queryable capability (#4794)

    commit d032c75
    Author: Maria Mandlis <mmandlis@chromium.org>
    Date:   Wed Mar 4 09:23:07 2020 -0800

        add creatimeTimestamp to entities (kt) (#4823)

    commit 30267fc
    Author: jblebrun <jibbl@google.com>
    Date:   Wed Mar 4 09:09:39 2020 -0800

        Remove some unused deps (#4831)

    commit c519181
    Author: Cameron Silvestrini <csilvestrini@users.noreply.github.com>
    Date:   Wed Mar 4 17:14:07 2020 +1100

        Increase size of DatabaseImplTest to medium (#4827)

        * Increase size of DatabaseImplTest to medium

        Was a bit flaky.

        * Check flakiness

        * Revert presubmit tweak

    commit fa621c6
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 22:05:07 2020 -0800

        Fix a race condition when setting up `ServiceStore` message channel (#4826)

        This seems to be the cause of the flakiness in `AndroidAllocatorTest`
        and `AndroidHandleManagerTest` (#4781)

    commit 78bf4f0
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Tue Mar 3 18:00:49 2020 -0800

        Utility to convert type proto to field type (if possible). (#4814)

    commit cae89c3
    Merge: 0360752 e587539
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 15:50:34 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

    commit e587539
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 15:07:16 2020 -0800

        Apply simplified test pattern tests in `arcs.android.host` (#4821)

        As in 5c6310d

    commit 1af1aac
    Author: Joshua Pratt <jp10010101010000@gmail.com>
    Date:   Wed Mar 4 09:48:15 2020 +1100

        Multinomials (#4804)

        * multinomial

        * added tests

        * making constant readable again

        * reindent

        * added multivariate rearrangement tests

        * updated comment

        * pr comments:

        Co-authored-by: Ragav Sachdeva <ragavsachdeva007@gmail.com>

    commit 0360752
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:42:31 2020 -0800

        fix, bad comparison op

    commit 4b05a28
    Merge: f4c1d26 99000c2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:18:14 2020 -0800

        Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

    commit f4c1d26
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 99000c2
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 140111f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:08:12 2020 -0800

        Removed flatMap, added TODOs and link to GH issue

    commit 5c6310d
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 11:02:34 2020 -0800

        Simplify service test pattern (#4817)

        * Make a simple test lifecycle registry, instead of creating empty
        testactivity

        * Remove use of `runBlockingTest`: according to
        Kotlin/kotlinx.coroutines#1222, if the test
        results in coroutines being finished on other threads, it's possible to
        receive "This job has not yet completed" exceptions, even though the
        jobs were properly terminated. Since we don't need the delay-skipping
        properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

    commit 472bc84
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:27:56 2020 -0800

        Improved build rules

    commit ca1ebf8
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:17:13 2020 -0800

        Impl suggestsions for r2p

    commit b5578ea
    Author: Jason Feinstein <jwf@google.com>
    Date:   Tue Mar 3 09:54:17 2020 -0800

        Add tests for dereferencing references to the HandleManagerTest(s) (#4816)

        * Add dereferencing tests to the android handle manager test.

        * Add dereferencing tests to core HandleManager.

    commit a695797
    Author: Jason Feinstein <jwf@google.com>
    Date:   Mon Mar 2 18:14:07 2020 -0800

        Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (#4812)

        * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

        Also: Create ParcelableReference.

        * Add dep. Also, apparently read/writeBoolean is Q-only.

        * Just write null if there is no version map.

        * Just write null if there is no version map.

    commit ba7a107
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Mon Mar 2 17:51:35 2020 -0800

        Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (#4793)

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * fixed nested tests

    * rewording, reorganizing

    * assert more ergonomic

commit 298fdcc
Author: Maria Mandlis <mmandlis@chromium.org>
Date:   Wed Mar 4 15:29:37 2020 -0800

    update wasm readme (#4832)

commit d15008e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:11:14 2020 -0800

    fixed build

commit bbfc3d2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:04:11 2020 -0800

    EntitySpec Interface can return a schema

commit 3b75c34
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 14:09:36 2020 -0800

    ktlint fix

commit 506457e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 13:59:46 2020 -0800

    addField arguments are more ergonomic

commit 579b2e6
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 13:45:28 2020 -0800

    grooming schema registry

commit 3cb8023
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:39:30 2020 -0800

    rm unused field

commit 1cff99f
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:38:32 2020 -0800

    rm import

commit 855401c
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:31:14 2020 -0800

    no difference w/ wasm golden

commit 552e9ad
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:26:43 2020 -0800

    Added test for mapOf

commit 1430907
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:07:15 2020 -0800

    sigh lint

commit 9c22195
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:06:50 2020 -0800

    minor adjustments

commit 74ae770
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:58:20 2020 -0800

    Improved shape of registry

commit f69f99b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:32:31 2020 -0800

    excluding wasm from generation

commit dcefb16
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:13:46 2020 -0800

    Generation adds to schema registry

commit f3b9ae5
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 07:57:15 2020 -0800

    packaging in a schema registry

commit 2ce6da2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 22:30:39 2020 -0800

    First iteration of schema gen on entities

* Squashed commit of the following:

commit b26f13e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 17:14:33 2020 -0800

    updated goldens

commit f66fdd8
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 16:56:26 2020 -0800

    further cleanup

commit 46b4f17
Merge: cfcf317 8621c58
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 16:54:11 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into kt-gen-utils

commit cfcf317
Merge: 60582ed 623daf7
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 16:28:56 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into kt-gen-utils

commit 60582ed
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 15:27:30 2020 -0800

    lint fix, added a test

commit 196a4a9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 15:16:35 2020 -0800

    cleaned up ktUtils, passing tests

commit 142fa2b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 17:42:04 2020 -0800

    first iteration for kt utils

commit e55cb0b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 17:36:00 2020 -0800

    Squashed commit of the following:

    commit 17a2ab1
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 16:30:45 2020 -0800

        Fixed indentation

    commit 9094055
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 16:03:51 2020 -0800

        revising from feedback

    commit d350821
    Merge: 9054c23 3acb7e7
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:56:55 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

    commit 9054c23
    Merge: d15008e 337b7b2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:55:27 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

    commit d15008e
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:11:14 2020 -0800

        fixed build

    commit bbfc3d2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:04:11 2020 -0800

        EntitySpec Interface can return a schema

    commit 3b75c34
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 14:09:36 2020 -0800

        ktlint fix

    commit 506457e
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 13:59:46 2020 -0800

        addField arguments are more ergonomic

    commit 579b2e6
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 13:45:28 2020 -0800

        grooming schema registry

    commit 3cb8023
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:39:30 2020 -0800

        rm unused field

    commit 1cff99f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:38:32 2020 -0800

        rm import

    commit 855401c
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:31:14 2020 -0800

        no difference w/ wasm golden

    commit 552e9ad
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:26:43 2020 -0800

        Added test for mapOf

    commit 1430907
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:07:15 2020 -0800

        sigh lint

    commit 9c22195
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:06:50 2020 -0800

        minor adjustments

    commit 74ae770
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 10:58:20 2020 -0800

        Improved shape of registry

    commit f69f99b
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 10:32:31 2020 -0800

        excluding wasm from generation

    commit dcefb16
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 10:13:46 2020 -0800

        Generation adds to schema registry

    commit f3b9ae5
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 07:57:15 2020 -0800

        packaging in a schema registry

    commit 2ce6da2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 22:30:39 2020 -0800

        First iteration of schema gen on entities

* using kt gen utils

* fixed merge issue

* Added new kt util

* creating handle connections

* handle connection map, lots of progress

* incomplete, but valid plan generator

* Groomed plan gen

* fix jvm golden

* 1 missing semicolon

* buildifier fix

* Code quality improvements.

* Code quality improvements.

* Added golden in testdata, revealed codegen issue from refactoring!

* Added golden test for r2p

* mv tests to goldens dir

* updating whitespace

* name change

* rm default package

* guard imports

Co-authored-by: Alex Rosengarten <alxrsngrtn@google.com>
alxmrs added a commit to PolymerLabs/arcs that referenced this issue Mar 10, 2020
## Summary
Enhances #4865, generates Types within Kotlin Plan classes.

For an example, see Golden's modification.

## Changelog
* creating structure of ts r2p script

* Created fast CLI rapper for r2p script

* WIP figuring out ways to resolve a recipe

* fix sp

* Passing lint, still WIP

* Build macros for recipe2plan work

* Lightweight iteration on recipe2plan, stubbed out tests

* Revised method to find corresponding create handles

* Added type info

* Added method to get all handles to manifest + get all handles by Id

* fix: no flatMap

* - currently, fails since it cannot find associated stores for handles.

* uncleaned, but working recipe resolution

* Cleaned up for r2p, pt 1

* Fixed test, added TODO

* Fixed build rule, simplified runtime

* tools/sigh lint

* Impl suggestsions for r2p

* Improved build rules

* Removed flatMap, added TODOs and link to GH issue

* fix, bad comparison op

* Stub plan generator works

* updated macro to take a package

* Testing import is conditional on package

* Incremental improvement

* tidying

* Fixed tests

* added particle creation method

* flushing out more of plan gen

* Squashed commit of the following:

commit 17a2ab1
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 16:30:45 2020 -0800

    Fixed indentation

commit 9094055
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 16:03:51 2020 -0800

    revising from feedback

commit d350821
Merge: 9054c23 3acb7e7
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:56:55 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

commit 3acb7e7
Author: Alex Rosengarten <alxr@google.com>
Date:   Wed Mar 4 15:56:42 2020 -0800

    XXS CL to add a hash field to the Schema proto (#4752)

commit 9054c23
Merge: d15008e 337b7b2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:55:27 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

commit 337b7b2
Author: Alex Rosengarten <alxr@google.com>
Date:   Wed Mar 4 15:55:06 2020 -0800

    recipe2plan 2/n: Validate Handles, Tests (#4834)

    * creating structure of ts r2p script

    * Created fast CLI rapper for r2p script

    * WIP figuring out ways to resolve a recipe

    * fix sp

    * Passing lint, still WIP

    * Build macros for recipe2plan work

    * Lightweight iteration on recipe2plan, stubbed out tests

    * Revised method to find corresponding create handles

    * Added type info

    * Added method to get all handles to manifest + get all handles by Id

    * fix: no flatMap

    * - currently, fails since it cannot find associated stores for handles.

    * uncleaned, but working recipe resolution

    * Cleaned up for r2p, pt 1

    * stubbed out second test (short, short)

    * Squashed commit of the following:

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * updates to test, can't get two to fail

    * Squashed commit of the following:

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * can't get test to fail... hmm...

    * Squashed commit of the following:

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * adjusting recipe copying to include triggers

    * Revert "adjusting recipe copying to include triggers"

    This reverts commit 9bc3734

    * four tests complete

    * Added test, fixed minor async issue

    * Squashed commit of the following:

    commit 4b05a28
    Merge: f4c1d26 99000c2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:18:14 2020 -0800

        Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

    commit f4c1d26
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 99000c2
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 140111f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:08:12 2020 -0800

        Removed flatMap, added TODOs and link to GH issue

    commit 5c6310d
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 11:02:34 2020 -0800

        Simplify service test pattern (#4817)

        * Make a simple test lifecycle registry, instead of creating empty
        testactivity

        * Remove use of `runBlockingTest`: according to
        Kotlin/kotlinx.coroutines#1222, if the test
        results in coroutines being finished on other threads, it's possible to
        receive "This job has not yet completed" exceptions, even though the
        jobs were properly terminated. Since we don't need the delay-skipping
        properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

    commit 472bc84
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:27:56 2020 -0800

        Improved build rules

    commit ca1ebf8
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:17:13 2020 -0800

        Impl suggestsions for r2p

    commit b5578ea
    Author: Jason Feinstein <jwf@google.com>
    Date:   Tue Mar 3 09:54:17 2020 -0800

        Add tests for dereferencing references to the HandleManagerTest(s) (#4816)

        * Add dereferencing tests to the android handle manager test.

        * Add dereferencing tests to core HandleManager.

    commit a695797
    Author: Jason Feinstein <jwf@google.com>
    Date:   Mon Mar 2 18:14:07 2020 -0800

        Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (#4812)

        * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

        Also: Create ParcelableReference.

        * Add dep. Also, apparently read/writeBoolean is Q-only.

        * Just write null if there is no version map.

        * Just write null if there is no version map.

    commit ba7a107
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Mon Mar 2 17:51:35 2020 -0800

        Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (#4793)

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * fix ineq

    * existing tests passing

    * Updating invalid type test

    * Squashed commit of the following:

    commit b3d92d0
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:17:17 2020 -0800

        updated test name

    commit ba7884b
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:16:09 2020 -0800

        nested unit tests

    commit ef36fdf
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:15:00 2020 -0800

        renamed to tryResolve

    commit 5703f02
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:07:18 2020 -0800

        rm generator

    commit 658cb1a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 12:01:54 2020 -0800

        implemented more review suggestions

    commit 0056ee3
    Merge: cae89c3 0f0f82a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:54:23 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

    commit 0f0f82a
    Author: Maria Mandlis <mmandlis@chromium.org>
    Date:   Wed Mar 4 09:33:29 2020 -0800

        add queryable capability (#4794)

    commit d032c75
    Author: Maria Mandlis <mmandlis@chromium.org>
    Date:   Wed Mar 4 09:23:07 2020 -0800

        add creatimeTimestamp to entities (kt) (#4823)

    commit 30267fc
    Author: jblebrun <jibbl@google.com>
    Date:   Wed Mar 4 09:09:39 2020 -0800

        Remove some unused deps (#4831)

    commit c519181
    Author: Cameron Silvestrini <csilvestrini@users.noreply.github.com>
    Date:   Wed Mar 4 17:14:07 2020 +1100

        Increase size of DatabaseImplTest to medium (#4827)

        * Increase size of DatabaseImplTest to medium

        Was a bit flaky.

        * Check flakiness

        * Revert presubmit tweak

    commit fa621c6
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 22:05:07 2020 -0800

        Fix a race condition when setting up `ServiceStore` message channel (#4826)

        This seems to be the cause of the flakiness in `AndroidAllocatorTest`
        and `AndroidHandleManagerTest` (#4781)

    commit 78bf4f0
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Tue Mar 3 18:00:49 2020 -0800

        Utility to convert type proto to field type (if possible). (#4814)

    commit cae89c3
    Merge: 0360752 e587539
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 15:50:34 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p

    commit e587539
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 15:07:16 2020 -0800

        Apply simplified test pattern tests in `arcs.android.host` (#4821)

        As in 5c6310d

    commit 1af1aac
    Author: Joshua Pratt <jp10010101010000@gmail.com>
    Date:   Wed Mar 4 09:48:15 2020 +1100

        Multinomials (#4804)

        * multinomial

        * added tests

        * making constant readable again

        * reindent

        * added multivariate rearrangement tests

        * updated comment

        * pr comments:

        Co-authored-by: Ragav Sachdeva <ragavsachdeva007@gmail.com>

    commit 0360752
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:42:31 2020 -0800

        fix, bad comparison op

    commit 4b05a28
    Merge: f4c1d26 99000c2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:18:14 2020 -0800

        Merge branch 'r2p' of github.com:alxrsngrtn/arcs into r2p

    commit f4c1d26
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 99000c2
    Merge: 140111f 5c6310d
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:14:35 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into r2p
        Fixed lint errors

    commit 140111f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 11:08:12 2020 -0800

        Removed flatMap, added TODOs and link to GH issue

    commit 5c6310d
    Author: jblebrun <jibbl@google.com>
    Date:   Tue Mar 3 11:02:34 2020 -0800

        Simplify service test pattern (#4817)

        * Make a simple test lifecycle registry, instead of creating empty
        testactivity

        * Remove use of `runBlockingTest`: according to
        Kotlin/kotlinx.coroutines#1222, if the test
        results in coroutines being finished on other threads, it's possible to
        receive "This job has not yet completed" exceptions, even though the
        jobs were properly terminated. Since we don't need the delay-skipping
        properties of `runBlockingTest`, I think it's OK to use `runBlocking`.

    commit 472bc84
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:27:56 2020 -0800

        Improved build rules

    commit ca1ebf8
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 10:17:13 2020 -0800

        Impl suggestsions for r2p

    commit b5578ea
    Author: Jason Feinstein <jwf@google.com>
    Date:   Tue Mar 3 09:54:17 2020 -0800

        Add tests for dereferencing references to the HandleManagerTest(s) (#4816)

        * Add dereferencing tests to the android handle manager test.

        * Add dereferencing tests to core HandleManager.

    commit a695797
    Author: Jason Feinstein <jwf@google.com>
    Date:   Mon Mar 2 18:14:07 2020 -0800

        Create RawEntityDereferencerTest, storage Reference-> CrdtEntity.Reference (#4812)

        * Create RawEntityDereferencerTest, make storage Reference implement CrdtEntity.Reference.

        Also: Create ParcelableReference.

        * Add dep. Also, apparently read/writeBoolean is Q-only.

        * Just write null if there is no version map.

        * Just write null if there is no version map.

    commit ba7a107
    Author: Gogul Balakrishnan <bgogul@google.com>
    Date:   Mon Mar 2 17:51:35 2020 -0800

        Add a decoder for PrimitiveTypeProto and an option to disable android constraints in BUILD. (#4793)

    commit f6df54a
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 15:44:32 2020 -0800

        tools/sigh lint

    commit bede8d9
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:52:02 2020 -0800

        Fixed build rule, simplified runtime

    commit 62dcc57
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Mon Mar 2 14:38:14 2020 -0800

        Fixed test, added TODO

    * fixed nested tests

    * rewording, reorganizing

    * assert more ergonomic

commit 298fdcc
Author: Maria Mandlis <mmandlis@chromium.org>
Date:   Wed Mar 4 15:29:37 2020 -0800

    update wasm readme (#4832)

commit d15008e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:11:14 2020 -0800

    fixed build

commit bbfc3d2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 15:04:11 2020 -0800

    EntitySpec Interface can return a schema

commit 3b75c34
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 14:09:36 2020 -0800

    ktlint fix

commit 506457e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 13:59:46 2020 -0800

    addField arguments are more ergonomic

commit 579b2e6
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 13:45:28 2020 -0800

    grooming schema registry

commit 3cb8023
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:39:30 2020 -0800

    rm unused field

commit 1cff99f
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:38:32 2020 -0800

    rm import

commit 855401c
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:31:14 2020 -0800

    no difference w/ wasm golden

commit 552e9ad
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:26:43 2020 -0800

    Added test for mapOf

commit 1430907
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:07:15 2020 -0800

    sigh lint

commit 9c22195
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 11:06:50 2020 -0800

    minor adjustments

commit 74ae770
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:58:20 2020 -0800

    Improved shape of registry

commit f69f99b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:32:31 2020 -0800

    excluding wasm from generation

commit dcefb16
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 10:13:46 2020 -0800

    Generation adds to schema registry

commit f3b9ae5
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 07:57:15 2020 -0800

    packaging in a schema registry

commit 2ce6da2
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Tue Mar 3 22:30:39 2020 -0800

    First iteration of schema gen on entities

* Squashed commit of the following:

commit b26f13e
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 17:14:33 2020 -0800

    updated goldens

commit f66fdd8
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 16:56:26 2020 -0800

    further cleanup

commit 46b4f17
Merge: cfcf317 8621c58
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 16:54:11 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into kt-gen-utils

commit cfcf317
Merge: 60582ed 623daf7
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 16:28:56 2020 -0800

    Merge branch 'master' of github.com:PolymerLabs/arcs into kt-gen-utils

commit 60582ed
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 15:27:30 2020 -0800

    lint fix, added a test

commit 196a4a9
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Thu Mar 5 15:16:35 2020 -0800

    cleaned up ktUtils, passing tests

commit 142fa2b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 17:42:04 2020 -0800

    first iteration for kt utils

commit e55cb0b
Author: Alex Rosengarten <alxrsngrtn@google.com>
Date:   Wed Mar 4 17:36:00 2020 -0800

    Squashed commit of the following:

    commit 17a2ab1
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 16:30:45 2020 -0800

        Fixed indentation

    commit 9094055
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 16:03:51 2020 -0800

        revising from feedback

    commit d350821
    Merge: 9054c23 3acb7e7
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:56:55 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

    commit 9054c23
    Merge: d15008e 337b7b2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:55:27 2020 -0800

        Merge branch 'master' of github.com:PolymerLabs/arcs into s2k-schemas

    commit d15008e
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:11:14 2020 -0800

        fixed build

    commit bbfc3d2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 15:04:11 2020 -0800

        EntitySpec Interface can return a schema

    commit 3b75c34
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 14:09:36 2020 -0800

        ktlint fix

    commit 506457e
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 13:59:46 2020 -0800

        addField arguments are more ergonomic

    commit 579b2e6
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 13:45:28 2020 -0800

        grooming schema registry

    commit 3cb8023
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:39:30 2020 -0800

        rm unused field

    commit 1cff99f
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:38:32 2020 -0800

        rm import

    commit 855401c
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:31:14 2020 -0800

        no difference w/ wasm golden

    commit 552e9ad
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:26:43 2020 -0800

        Added test for mapOf

    commit 1430907
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:07:15 2020 -0800

        sigh lint

    commit 9c22195
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 11:06:50 2020 -0800

        minor adjustments

    commit 74ae770
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 10:58:20 2020 -0800

        Improved shape of registry

    commit f69f99b
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 10:32:31 2020 -0800

        excluding wasm from generation

    commit dcefb16
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 10:13:46 2020 -0800

        Generation adds to schema registry

    commit f3b9ae5
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Wed Mar 4 07:57:15 2020 -0800

        packaging in a schema registry

    commit 2ce6da2
    Author: Alex Rosengarten <alxrsngrtn@google.com>
    Date:   Tue Mar 3 22:30:39 2020 -0800

        First iteration of schema gen on entities

* using kt gen utils

* fixed merge issue

* Added new kt util

* creating handle connections

* handle connection map, lots of progress

* incomplete, but valid plan generator

* Groomed plan gen

* fix jvm golden

* 1 missing semicolon

* Impl createType w/ tests

* buildifier fix

* Code quality improvements.

* Code quality improvements.

* Added golden in testdata, revealed codegen issue from refactoring!

* Added golden test for r2p

* mv tests to goldens dir

* updating whitespace

* name change

* rm default package

* guard imports

* fixes: now passing tests after merge

* fix: need to wrap a list

* extracted generic function to kt utils

* using schemas on specs

* using schemas on specs

* Fixed tests

* clean up

* impl suggestions from feedback

* fixed lint / functionality issue

* schema --> SCHEMA

* rm unused imports

* Fixed the reference key issue; added Flags function

* better plance for `Flags` call

Co-authored-by: Alex Rosengarten <alxrsngrtn@google.com>
@mateuszkwiecinski
Copy link

@mateuszkwiecinski mateuszkwiecinski commented Apr 6, 2020

@qwwdfsad Is there any place where we can track the progress?
I can see the #1206 was closed, but I couldn't find any further updates.

@twyatt
Copy link
Contributor

@twyatt twyatt commented Apr 16, 2020

@mateuszkwiecinski

@glasser
Copy link
Contributor

@glasser glasser commented Apr 24, 2020

FWIW I've been using https://github.com/kotest/kotest for new tests, which just supports coroutines without having to do anything like runBlockingTest at all, and it's been great overall.

@Laukess
Copy link

@Laukess Laukess commented Apr 24, 2020

Wrote this earlier, but ended up deleting it because I though I hadn't fixed the issue after all. Turned out it was unrelated.

Not sure if it's painfully obvious to everyone else, but I had a lot of issues with this, because I didn't understand the problem.

I use a TestCoroutineScope for my tests.
@get: Rule
var mainCoroutineRule = MainCoroutineRule()

Not sure about the details, but I think it replaces every Dispatcher.MAIN with a test dispatcher.
The "This job has not completed yet" pop up when you call code that doesn't run on Dispatchers.MAIN, like Dispatchers.IO

My repository is filled with code that runs on Dispatchers.IO. To fix this issue, the repository constructor now takes a Dispatcher as a parameter,
and to make it work work with the rest of my code without changes, it defaults to the Dispatchers.IO

Whenever I run tests now, I pass in the TestCoroutineScope.dispatcher to the repository, and everything works as expected.

@nuhkoca
Copy link

@nuhkoca nuhkoca commented Apr 25, 2020

Wrote this earlier, but ended up deleting it because I though I hadn't fixed the issue after all. Turned out it was unrelated.

Not sure if it's painfully obvious to everyone else, but I had a lot of issues with this, because I didn't understand the problem.

I use a TestCoroutineScope for my tests.
@get: Rule
var mainCoroutineRule = MainCoroutineRule()

Not sure about the details, but I think it replaces every Dispatcher.MAIN with a test dispatcher.
The "This job has not completed yet" pop up when you call code that doesn't run on Dispatchers.MAIN, like Dispatchers.IO

My repository is filled with code that runs on Dispatchers.IO. To fix this issue, the repository constructor now takes a Dispatcher as a parameter,
and to make it work work with the rest of my code without changes, it defaults to the Dispatchers.IO

Whenever I run tests now, I pass in the TestCoroutineScope.dispatcher to the repository, and everything works as expected.

Yes I confirm this behavior, I have started to inject Dispatcher in constructors and now all my tests pass

@Xerosigma
Copy link

@Xerosigma Xerosigma commented Jun 24, 2020

Using runBlocking instead of runBlockingTest worked for me as well.

@jerryOkafor
Copy link

@jerryOkafor jerryOkafor commented Aug 22, 2020

In my case, I had to do this while using runBlockingTest:

val job = launch {
            val tasksLists = tasksLisDao.tasksLists()

            assertEquals(tasksLists.toList(), testValues)
        }

        job.cancel()

I am not sure if it is the right way but the test passed thou.

@yuvaraj119
Copy link

@yuvaraj119 yuvaraj119 commented Aug 25, 2020

In my case, I had to do this while using runBlockingTest:

val job = launch {
            val tasksLists = tasksLisDao.tasksLists()

            assertEquals(tasksLists.toList(), testValues)
        }

        job.cancel()

I am not sure if it is the right way but the test passed thou.

using this if assert value is not equal then also the test will get pass

@yuvaraj119
Copy link

@yuvaraj119 yuvaraj119 commented Aug 25, 2020

This code worked in my scenario where repo.task() is an API call with error "This job has not completed yet"

@Test
    fun getMethod() = runBlocking {
         val result = withTimeoutOrNull(1300L) {
           repo.task()
         }
         assertEquals(expected, actual)
        Unit
   }

make sure task() is suspendCancellableCoroutine

@DDihanov
Copy link

@DDihanov DDihanov commented Sep 2, 2020

My problem was I was using Robolectric to test a class that used Google's LocationProvider for Location and using a suspend function locationManager.getLocation() which caused the exception with runBlockingTest .

The only solution was this to use GlobalScope.launch { } to test it. I didn't even need the coroutine test rules or anything:

class LocationManager(private val fusedLocationProviderClient: FusedLocationProviderClient) {

    @SuppressLint("MissingPermission")
    suspend fun getLocation(): LocationCoordinates? =
        fusedLocationProviderClient.lastLocation.await().toLocationCoordinates()

    data class LocationCoordinates(val long: Double, val lat: Double)

    private fun Location.toLocationCoordinates(): LocationCoordinates = LocationCoordinates(this.longitude, this.latitude)
}
@RunWith(AndroidJUnit4::class)
@Config(sdk = [Build.VERSION_CODES.P])
class LocationManagerTest {
    private lateinit var locationManager: LocationManager

    @Before
    fun setUp() {
        val client = LocationServices.getFusedLocationProviderClient(getApplicationContext() as Context)
        client.setMockMode(true)
        val location = Location("lol")
        location.longitude = 11.0
        location.latitude = 12.0
        client.setMockLocation(location)
        locationManager = LocationManager(client)
    }

    @Test
    fun `test location coordinates`() {
        GlobalScope.launch {
            val location = locationManager.getLocation()
            assertEquals(location!!.long, 11.0)
            assertEquals(location.lat, 12.0)
        }
    }
}

Initially I was running the test like this, with coroutine test dispatchers and instant task executor rules and whatnot, and got the Job not completed exception:

    @Test
    fun `test location coordinates`() = runBlockingTest {
            val location = locationManager.getLocation()
            assertEquals(location!!.long, 11.0)
            assertEquals(location.lat, 12.0)
    }

this also caused an exception:

    @Test
    fun `test location coordinates`() = testContextProvider.testCoroutineDispatcher.runBlockingTest {
          val location = locationManager.getLocation()
            assertEquals(location!!.long, 11.0)
            assertEquals(location.lat, 12.0)
    }

Maybe this will help someone.

@edgarkhimich
Copy link

@edgarkhimich edgarkhimich commented Oct 6, 2020

Want to test this simple funtion

suspend fun resetPassword(email: String) {
        val forgotPasswordData = ForgotPasswordData(email)
        restClient.user(sharedPreferencesStore.sessionTokenId).forgotPassword(forgotPasswordData)
    }

restClient.user() returns MariaUserRoutes

fun user(sessionToken: String): MariaUserRoutes {
        return get(parameters = { parametersOf(applicationId, baseUrl, sessionToken) })
}

MariaUserRoutes.forgotPassword doesn't return anything

suspend fun forgotPassword(data: ForgotPasswordData) = RestRequest<Unit>(
        RestRequestComponents(
            "$baseUrl/user/forgotpassword",
            get<HeadersGenerator>().getHeaders(applicationId),
            data.toJson().toByteArray(),
            RequestMethod.POST
        )
    ).send()

This is my test:

@Test
 fun `Should login successfully`() {
        testCoroutineRule.runBlockingTest {
            val loginData = LoginData(email, password)
            val loginResult = LoginResult(user, session)
            val mariaUserRoutes = MariaUserRoutes("applicationId", "baseUrl", session.token)
            whenever(sharedPreferencesStore.sessionTokenId).thenReturn(session.token)

            whenever(restClient.user(sharedPreferencesStore.sessionTokenId)).thenReturn(mariaUserRoutes)
            whenever(mariaUserRoutes.login(loginData)).thenReturn(loginResult)

            loginManager.login(email, password)

            verify(restClient).user(any())
        }
    }

Using Robolectric
I was also trying to use coroutine flow, GlobalScope and just runBlocking - neither of these approaches worked
Probably I'm doing something wrong

@PS5020156
Copy link

@PS5020156 PS5020156 commented Nov 10, 2020

you can add rule

@get: Rule
var instantTaskExecutorRule = InstantTaskExecutorRule()

this will resolve the issue and make sure instantTaskExecutorRule is not private.

@PS5020156
Copy link

@PS5020156 PS5020156 commented Nov 10, 2020

Sample code::

@RunWith(AndroidJUnit4::class)
@smallTest
class GalleryDaoTest {

@get: Rule
var instantTaskExecutorRule = InstantTaskExecutorRule()

private lateinit var database: GalleryDatabase
private lateinit var dao: GalleryDao

@Before
fun setUp() {
    database = Room.inMemoryDatabaseBuilder(ApplicationProvider.getApplicationContext(), GalleryDatabase::class.java).allowMainThreadQueries().build()
    dao = database.getGalleryDao()
}

@Test
fun insertGallery() = runBlockingTest {

    val galleryItem = GalleriesItem(1,1, "url", "title", "body")
    dao.insertGallery(galleryItem)
    val result = dao.getAllGalleries().getOrAwaitValue()
    assertThat(result).contains(galleryItem)
}

}
}

dkhalanskyjb added a commit that referenced this issue Nov 1, 2021
Implement a multiplatform runTest as an initial implementation of #1996.

Fixes #1204
Fixes #1222
Fixes #1395
Fixes #1881
Fixes #1910
Fixes #1772
dkhalanskyjb added a commit that referenced this issue Nov 17, 2021
Implement a multiplatform runTest as an initial implementation of #1996.

Fixes #1204
Fixes #1222
Fixes #1395
Fixes #1881
Fixes #1910
Fixes #1772
dkhalanskyjb added a commit that referenced this issue Nov 17, 2021
Implement a multiplatform runTest as an initial implementation of #1996.

Fixes #1204
Fixes #1222
Fixes #1395
Fixes #1881
Fixes #1910
Fixes #1772
dkhalanskyjb added a commit that referenced this issue Nov 19, 2021
Implement a multiplatform runTest as an initial implementation of #1996.

Fixes #1204
Fixes #1222
Fixes #1395
Fixes #1881
Fixes #1910
Fixes #1772
franmontiel added a commit to mobilejazz/harmony-kotlin that referenced this issue Dec 3, 2021
yorickhenning pushed a commit to yorickhenning/kotlinx.coroutines that referenced this issue Jan 28, 2022
This commit introduces the new version of the test module.
Please see README.md and MIGRATION.md for a thorough
discussion of the changes.

Fixes Kotlin#1203
Fixes Kotlin#1609
Fixes Kotlin#2379
Fixes Kotlin#1749
Fixes Kotlin#1204
Fixes Kotlin#1390
Fixes Kotlin#1222
Fixes Kotlin#1395
Fixes Kotlin#1881
Fixes Kotlin#1910
Fixes Kotlin#1772
Fixes Kotlin#1626
Fixes Kotlin#1742
Fixes Kotlin#2082
Fixes Kotlin#2102
Fixes Kotlin#2405
Fixes Kotlin#2462

Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests