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

Fix Local Smoke Tests by Allowing ScriptSessionCacheInit's mkdir to Race in Parallel Tests #5465

Merged
merged 3 commits into from
May 14, 2024

Conversation

nbauernfeind
Copy link
Member

Turns out that NoConsoleSessionModule is used in the testing context and if we simply do not require the ScriptSessionCacheInit then it no longer fails. I've left a few null checks in tearDown that fix cascading failures when setUp throws an exception in a super class.

@nbauernfeind nbauernfeind added core Core development tasks NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels May 8, 2024
@nbauernfeind nbauernfeind requested a review from rcaudy May 8, 2024 17:29
@nbauernfeind nbauernfeind self-assigned this May 8, 2024
@rcaudy
Copy link
Member

rcaudy commented May 8, 2024

This feels like we're working around the fact that our processes expect exclusive ownership of their "cache" directory.

@devinrsmith
Copy link
Member

I'm getting this too, which ultimately causes teardown NPEs.

Failed to create class cache directory /tmp/deephaven/cache/script-session-classes
io.deephaven.UncheckedDeephavenException: Failed to create class cache directory /tmp/deephaven/cache/script-session-classes
	at io.deephaven.engine.util.AbstractScriptSession.createOrClearDirectory(AbstractScriptSession.java:63)
	at io.deephaven.engine.util.AbstractScriptSession.createScriptCache(AbstractScriptSession.java:54)
	at io.deephaven.server.console.ScriptSessionCacheInit.<init>(ScriptSessionCacheInit.java:17)
	at io.deephaven.server.console.ConsoleModule.bindScriptSessionCacheInit(ConsoleModule.java:32)
	at io.deephaven.server.console.ConsoleModule_BindScriptSessionCacheInitFactory.bindScriptSessionCacheInit(ConsoleModule_BindScriptSessionCacheInitFactory.java:32)
	at io.deephaven.server.console.ConsoleModule_BindScriptSessionCacheInitFactory.get(ConsoleModule_BindScriptSessionCacheInitFactory.java:24)
	at io.deephaven.server.console.ConsoleModule_BindScriptSessionCacheInitFactory.get(ConsoleModule_BindScriptSessionCacheInitFactory.java:10)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at io.deephaven.server.console.NoConsoleSessionModule_BindNoLanguageSessionFactory.get(NoConsoleSessionModule_BindNoLanguageSessionFactory.java:46)
	at io.deephaven.server.console.NoConsoleSessionModule_BindNoLanguageSessionFactory.get(NoConsoleSessionModule_BindNoLanguageSessionFactory.java:14)
	at io.deephaven.server.console.NoConsoleSessionModule_BindScriptSessionFactory.get(NoConsoleSessionModule_BindScriptSessionFactory.java:37)
	at io.deephaven.server.console.NoConsoleSessionModule_BindScriptSessionFactory.get(NoConsoleSessionModule_BindScriptSessionFactory.java:13)
	at io.deephaven.server.session.ScriptSessionModule.provideScriptSession(ScriptSessionModule.java:31)
	at io.deephaven.server.session.ScriptSessionModule_ProvideScriptSessionFactory.provideScriptSession(ScriptSessionModule_ProvideScriptSessionFactory.java:44)
	at io.deephaven.server.session.ScriptSessionModule_ProvideScriptSessionFactory.get(ScriptSessionModule_ProvideScriptSessionFactory.java:34)
	at io.deephaven.server.session.ScriptSessionModule_ProvideScriptSessionFactory.get(ScriptSessionModule_ProvideScriptSessionFactory.java:13)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at io.deephaven.server.appmode.ApplicationInjector.loadApplicationFactory(ApplicationInjector.java:101)
	at io.deephaven.server.appmode.ApplicationInjector.run(ApplicationInjector.java:48)
	at io.deephaven.server.runner.DeephavenApiServer.startForUnitTests(DeephavenApiServer.java:242)
	at io.deephaven.server.runner.DeephavenApiServerTestBase.setUp(DeephavenApiServerTestBase.java:139)
	at io.deephaven.client.DeephavenSessionTestBase.setUp(DeephavenSessionTestBase.java:28)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at io.grpc.testing.GrpcCleanupRule$1.evaluate(GrpcCleanupRule.java:153)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:112)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)

I'm able to workaround it right now by setting --max-workers 1, but that's not a very satisfying solution.

@nbauernfeind nbauernfeind changed the title Fix local smoke testing by removing ScriptSessionCacheInit in test-only NoConsoleSessionModule Fix Local Smoke Tests by Allowing ScriptSessionCacheInit's mkdir to Race in Parallel Tests May 14, 2024
@nbauernfeind nbauernfeind merged commit d621b2f into deephaven:main May 14, 2024
15 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core Core development tasks NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants