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

test_suite cycles crash Bazel #5851

Closed
benjaminp opened this issue Aug 9, 2018 · 0 comments
Closed

test_suite cycles crash Bazel #5851

benjaminp opened this issue Aug 9, 2018 · 0 comments
Labels
team-Rules-Server Issues for serverside rules included with Bazel type: bug untriaged

Comments

@benjaminp
Copy link
Collaborator

$ bazel version
Build label: 
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Aug 9 18:23:10 2018 (1533838990)
Build timestamp: 1533838990
Build timestamp as int: 1533838990
$ touch WORKSPACE
$ cat > BUILD 
test_suite(name = 'a', tests = [':b'])
test_suite(name = 'b', tests = [':a'])
$ bazel build //:a
Unhandled exception thrown during build; message: topLevelKey: [//:a] EXPAND_TEST_SUITES com.google.devtools.build.lib.pkgcache.TestFilter@e17a1
alreadyReported: false
path to cycle:
[//:a] EXPAND_TEST_SUITES com.google.devtools.build.lib.pkgcache.TestFilter@e17a1
ExpandTestSuites([//:a])
cycle:
TestsInSuite(//:a, strict=true)
TestsInSuite(//:b, strict=true)

INFO: Elapsed time: 0.398s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)
java.lang.IllegalStateException: topLevelKey: [//:a] EXPAND_TEST_SUITES com.google.devtools.build.lib.pkgcache.TestFilter@e17a1
alreadyReported: false
path to cycle:
[//:a] EXPAND_TEST_SUITES com.google.devtools.build.lib.pkgcache.TestFilter@e17a1
ExpandTestSuites([//:a])
cycle:
TestsInSuite(//:a, strict=true)
TestsInSuite(//:b, strict=true)

	at com.google.common.base.Preconditions.checkState(Preconditions.java:507)
	at com.google.devtools.build.skyframe.CyclesReporter.reportCycles(CyclesReporter.java:85)
	at com.google.devtools.build.lib.skyframe.SkyframeExecutor.loadTargetPatterns(SkyframeExecutor.java:2240)
	at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.evaluateTargetPatterns(AnalysisPhaseRunner.java:170)
	at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:85)
	at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:143)
	at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:262)
	at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:83)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:484)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:204)
	at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:870)
	at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:111)
	at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:939)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
java.lang.IllegalStateException: topLevelKey: [//:a] EXPAND_TEST_SUITES com.google.devtools.build.lib.pkgcache.TestFilter@e17a1
alreadyReported: false
path to cycle:
[//:a] EXPAND_TEST_SUITES com.google.devtools.build.lib.pkgcache.TestFilter@e17a1
ExpandTestSuites([//:a])
cycle:
TestsInSuite(//:a, strict=true)
TestsInSuite(//:b, strict=true)

	at com.google.common.base.Preconditions.checkState(Preconditions.java:507)
	at com.google.devtools.build.skyframe.CyclesReporter.reportCycles(CyclesReporter.java:85)
	at com.google.devtools.build.lib.skyframe.SkyframeExecutor.loadTargetPatterns(SkyframeExecutor.java:2240)
	at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.evaluateTargetPatterns(AnalysisPhaseRunner.java:170)
	at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:85)
	at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:143)
	at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:262)
	at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:83)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:484)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:204)
	at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:870)
	at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:111)
	at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:939)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
FAILED: Build did NOT complete successfully (1 packages loaded)
@dslomov dslomov added team-Rules-Server Issues for serverside rules included with Bazel type: bug untriaged labels Aug 10, 2018
benjaminp added a commit to benjaminp/bazel that referenced this issue Sep 3, 2018
Test suite cycles now produce nice cycle errors like this:

ERROR /workspace/BUILD:1:41: in test_suite rule //:b: cycle in dependency graph:
.-> //:b
|   //:a
`-- //:b

Before, test_suite cycles resulted in a crash.

Fixes bazelbuild#5851.
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    Test suite cycles now produce nice cycle errors like this:

    ERROR /workspace/BUILD:1:41: in test_suite rule //:b: cycle in dependency graph:
    .-> //:b
    |   //:a
    `-- //:b

    Before, test_suite cycles resulted in a crash.

    Fixes bazelbuild/bazel#5851.

    Closes #6066.

    PiperOrigin-RevId: 215373465
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-Server Issues for serverside rules included with Bazel type: bug untriaged
Projects
None yet
Development

No branches or pull requests

2 participants