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

Bazel CI failure: Bazel test command is too long on Windows #3742

Closed
meteorcloudy opened this issue Sep 15, 2017 · 13 comments
Closed

Bazel CI failure: Bazel test command is too long on Windows #3742

meteorcloudy opened this issue Sep 15, 2017 · 13 comments
Assignees
Labels
breakage P1 I'll work on this now. (Assignee required) platform: windows

Comments

@meteorcloudy
Copy link
Member

http://ci.bazel.io/blue/rest/organizations/jenkins/pipelines/CR/pipelines/bazel-tests/runs/383/nodes/36/steps/468/log/?start=0

All tests passed, but we are getting an error:

ERROR: Skipping '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdaa_by_disabling_lambda_desugaring_test': no such target '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdaa_by_disabling_lambda_desugaring_test': target 'desugar_testdaa_by_disabling_lambda_desugaring_test' not declared in package 'src/test/java/com/google/devtools/build/android/desugar' (did you mean 'desugar_testdata_by_disabling_lambda_desugaring_test'?) defined by C:/jenkins/workspace/cr/bazel-tests-node=windows-x86_64,toolchain=msvc/src/test/java/com/google/devtools/build/android/desugar/BUILD.
ERROR: Skipping '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdaa_by_disabling_lambda_desugaring_test': no such target '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdaa_by_disabling_lambda_desugaring_test': target 'desugar_testdaa_by_disabling_lambda_desugaring_test' not declared in package 'src/test/java/com/google/devtools/build/android/desugar' (did you mean 'desugar_testdata_by_disabling_lambda_desugaring_test'?) defined by C:/jenkins/workspace/cr/bazel-tests-node=windows-x86_64,toolchain=msvc/src/test/java/com/google/devtools/build/android/desugar/BUILD.

I suspect this is because the bazel test command exceeds the max length (8K) of command line on Windows.

c:\bazel_ci\installs\latest\bazel.exe --bazelrc=c:\jenkins\workspace\CR\bazel-tests-node=windows-x86_64,toolchain=msvc/bazel.bazelrc test //third_party/def_parser:def_parser_test //src/tools/launcher/util:util_test //src/tools/launcher/util:data_parser_test //src/test/shell/bazel:bazel_windows_example_test //src/test/shell/bazel:bazel_bootstrap_distfile_test //src/test/py/bazel:launcher_test //src/test/py/bazel:bazel_windows_test //src/test/py/bazel:bazel_windows_dynamic_link_test //src/test/py/bazel:bazel_server_mode_test //src/test/py/bazel:bazel_external_repository_test //src/test/py/bazel:bazel_clean_test //src/test/native:windows_jni_test //src/test/java/com/google/devtools/common/options/testing:OptionsTesterTest //src/test/java/com/google/devtools/common/options:options_test //src/test/java/com/google/devtools/build/skyframe:skyframe_base_test //src/test/java/com/google/devtools/build/lib/skylark:SkylarkTests //src/test/java/com/google/devtools/build/lib/skyframe/serialization:SerializationTests //src/test/java/com/google/devtools/build/lib/skyframe/packages:BazelPackageLoaderTest //src/test/java/com/google/devtools/build/lib/skyframe:SkyframeTests //src/test/java/com/google/devtools/build/lib/rules/repository:RepositoryTests //src/test/java/com/google/devtools/build/lib/rules/platform:PlatformRulesTests //src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests //src/test/java/com/google/devtools/build/lib/rules/config:ConfigRulesTests //src/test/java/com/google/devtools/build/lib/rules/apple:AppleRulesTests //src/test/java/com/google/devtools/build/lib/rules/apple:AppleConfigurationSerializationTest //src/test/java/com/google/devtools/build/lib/rules/android:ResourceFilterTest //src/test/java/com/google/devtools/build/lib/rules/android:LocalResourceContainerTest //src/test/java/com/google/devtools/build/lib/rules/android:ApkManifestActionTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidSkylarkSplitTransitionTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidLibraryTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidInstrumentationTestTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidInstrumentationRuleImplTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidHostServiceFixtureTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidDeviceTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidDeviceScriptFixtureTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidDataBindingTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidCommonTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidBinaryTest //src/test/java/com/google/devtools/build/lib/rules/android:AndroidBinaryMultidexTest //src/test/java/com/google/devtools/build/lib/buildtool:BuildtoolTests //src/test/java/com/google/devtools/build/lib/buildeventstream/transports:BuildEventTransportTest //src/test/java/com/google/devtools/build/lib/buildeventservice:BuildEventServiceTest //src/test/java/com/google/devtools/build/lib/bazel/repository/downloader:DownloaderTestSuite //src/test/java/com/google/devtools/build/lib/bazel/repository/cache:RepositoryCacheTests //src/test/java/com/google/devtools/build/lib/bazel/repository:RepositoryTests //src/test/java/com/google/devtools/build/lib/analysis/whitelisting:WhitelistingTests //src/test/java/com/google/devtools/build/lib/analysis/platform:PlatformAnalysisTests //src/test/java/com/google/devtools/build/lib:worker-tests //src/test/java/com/google/devtools/build/lib:windows_test //src/test/java/com/google/devtools/build/lib:windows-tests //src/test/java/com/google/devtools/build/lib:test-rules-tests //src/test/java/com/google/devtools/build/lib:syntax_test //src/test/java/com/google/devtools/build/lib:standalone-tests //src/test/java/com/google/devtools/build/lib:shell_test //src/test/java/com/google/devtools/build/lib:server_test //src/test/java/com/google/devtools/build/lib:sandbox-tests //src/test/java/com/google/devtools/build/lib:runtime-tests //src/test/java/com/google/devtools/build/lib:rules-tests //src/test/java/com/google/devtools/build/lib:remote-tests //src/test/java/com/google/devtools/build/lib:profiler-tests //src/test/java/com/google/devtools/build/lib:pkgcache_test //src/test/java/com/google/devtools/build/lib:packages_test //src/test/java/com/google/devtools/build/lib:java-rules-tests //src/test/java/com/google/devtools/build/lib:graph_test //src/test/java/com/google/devtools/build/lib:foundations_test //src/test/java/com/google/devtools/build/lib:filegroup-rules-tests //src/test/java/com/google/devtools/build/lib:exec-tests //src/test/java/com/google/devtools/build/lib:exec-local-tests //src/test/java/com/google/devtools/build/lib:cpp-rules-tests //src/test/java/com/google/devtools/build/lib:bazel-rules-tests //src/test/java/com/google/devtools/build/lib:analysis_test //src/test/java/com/google/devtools/build/lib:analysis_select_test //src/test/java/com/google/devtools/build/lib:analysis_constraints_test //src/test/java/com/google/devtools/build/lib:analysis_config_test //src/test/java/com/google/devtools/build/lib:analysis_actions_test //src/test/java/com/google/devtools/build/lib:actions_test //src/test/java/com/google/devtools/build/lib:StrictDepsUtilsTest //src/test/java/com/google/devtools/build/lib:ProtoLangToolchainTest //src/test/java/com/google/devtools/build/lib:ProtoCompileActionBuilderTest //src/test/java/com/google/devtools/build/lib:CcProtoLibraryTest //src/test/java/com/google/devtools/build/lib:BazelProtoLibraryTest //src/test/java/com/google/devtools/build/lib:BazelDocumentationTests //src/test/java/com/google/devtools/build/docgen:DocumentationTests //src/test/java/com/google/devtools/build/android/ziputils:ziputils-tests //src/test/java/com/google/devtools/build/android/resources:RClassGeneratorTest //src/test/java/com/google/devtools/build/android/junctions:JunctionCreatorTest //src/test/java/com/google/devtools/build/android/idlclass:IdlClassTest //src/test/java/com/google/devtools/build/android/dexer:AllTests //src/test/java/com/google/devtools/build/android/desugar/runtime:ThrowableExtensionTestWithReuseDesugaringStrategy //src/test/java/com/google/devtools/build/android/desugar/runtime:ThrowableExtensionTestWithNullDesugaringStrategy //src/test/java/com/google/devtools/build/android/desugar/runtime:ThrowableExtensionTestWithMimicDesugaringStrategy //src/test/java/com/google/devtools/build/android/desugar/runtime:ConcurrentWeakIdentityHashMapTest //src/test/java/com/google/devtools/build/android/desugar:testdata_sanity_test //src/test/java/com/google/devtools/build/android/desugar:testdata_desugared_twice_jar_test //src/test/java/com/google/devtools/build/android/desugar:testdata_desugared_java8_jar_test //src/test/java/com/google/devtools/build/android/desugar:testdata_desugared_jar_test //src/test/java/com/google/devtools/build/android/desugar:testdata_desugared_for_try_with_resources_test_twice //src/test/java/com/google/devtools/build/android/desugar:testdata_desugared_for_try_with_resources_test //src/test/java/com/google/devtools/build/android/desugar:testdata_desugared_for_disabling_try_with_resources_with_large_minsdkversion_test //src/test/java/com/google/devtools/build/android/desugar:testdata_desugared_core_library_jar_test //src/test/java/com/google/devtools/build/android/desugar:stateless_lambda_has_no_factory_method_test //src/test/java/com/google/devtools/build/android/desugar:simple_method_reference_has_no_factory_method_test //src/test/java/com/google/devtools/build/android/desugar:no_stubs_for_lambdas_in_implemented_interface //src/test/java/com/google/devtools/build/android/desugar:jacoco_legacy_default_method_regression_test //src/test/java/com/google/devtools/build/android/desugar:interface_has_method_bodies_removed //src/test/java/com/google/devtools/build/android/desugar:initializer_of_functional_interface_should_not_execute //src/test/java/com/google/devtools/build/android/desugar:inherited_abstract_method_gets_no_default_method_stub //src/test/java/com/google/devtools/build/android/desugar:desugar_testda
@meteorcloudy
Copy link
Member Author

meteorcloudy commented Sep 15, 2017

@damienmg , the tests are returned by bazel query command, can we just run the tests instead of doing a query first?

@damienmg
Copy link
Contributor

damienmg commented Sep 18, 2017 via email

@davido
Copy link
Contributor

davido commented Sep 18, 2017

Why not just to use the standard approach on windows and provide respone file as input instead of too long command line? This is what LibreOffice build tool chain is doing in all places.

See for example: [1].

@damienmg
Copy link
Contributor

damienmg commented Sep 18, 2017 via email

@meteorcloudy
Copy link
Member Author

@laszlocsomor
Copy link
Contributor

Thanks @meteorcloudy !

I also see this in the log:

ERROR: Skipping '//src/test/java/om/google/devtools/build/android/desugar:desugar_idempotency_test': no such package 'src/test/java/om/google/devtools/build/android/desugar': BUILD file not found on package path.
ERROR: Skipping '//src/test/java/om/google/devtools/build/android/desugar:desugar_idempotency_test': no such package 'src/test/java/om/google/devtools/build/android/desugar': BUILD file not found on package path.

Notice it says "java/om/google/..." instead of "java/com/google/..."

@meteorcloudy
Copy link
Member Author

Yes, I noticed the same thing, I guess it's somehow caused by the command line being too long?

@laszlocsomor laszlocsomor added the P1 I'll work on this now. (Assignee required) label Sep 18, 2017
@laszlocsomor
Copy link
Contributor

I think we can work around this problem if we create test_suite rules.

@laszlocsomor laszlocsomor self-assigned this Sep 18, 2017
@laszlocsomor
Copy link
Contributor

laszlocsomor commented Sep 19, 2017

New occurrence:

http://ci.bazel.io/view/Dashboard/job/bazel-tests/1036/consoleFull

[node=windows-x86_64,toolchain=msvc] ERROR: Skipping '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdata_y_disabling_lambda_desugaring_test': no such target '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdata_y_disabling_lambda_desugaring_test': target 'desugar_testdata_y_disabling_lambda_desugaring_test' not declared in package 'src/test/java/com/google/devtools/build/android/desugar' (did you mean 'desugar_testdata_by_disabling_lambda_desugaring_test'?) defined by C:/jenkins/workspace/bazel-tests-node=windows-x86_64,toolchain=msvc/src/test/java/com/google/devtools/build/android/desugar/BUILD.
[node=windows-x86_64,toolchain=msvc] ERROR: Skipping '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdata_y_disabling_lambda_desugaring_test': no such target '//src/test/java/com/google/devtools/build/android/desugar:desugar_testdata_y_disabling_lambda_desugaring_test': target 'desugar_testdata_y_disabling_lambda_desugaring_test' not declared in package 'src/test/java/com/google/devtools/build/android/desugar' (did you mean 'desugar_testdata_by_disabling_lambda_desugaring_test'?) defined by C:/jenkins/workspace/bazel-tests-node=windows-x86_64,toolchain=msvc/src/test/java/com/google/devtools/build/android/desugar/BUILD.
...
[node=windows-x86_64,toolchain=msvc] ERROR: command succeeded, but there were errors parsing the target pattern.
...
[node=windows-x86_64,toolchain=msvc] ERROR: command succeeded, but there were errors parsing the target pattern.

@aj-michael
Copy link
Contributor

Am I understanding this correctly that Windows is removing characters from the middle of the command line when the length is too long? testdata --> testdaa, com --> om, by --> y

@laszlocsomor
Copy link
Contributor

I don't know what mangled the pattern names in the error message... But I have a fix for the long command problem: https://bazel-review.googlesource.com/c/bazel/+/16910

bazel-io pushed a commit that referenced this issue Sep 19, 2017
Add recursive test_suite rules for all tests that
ci.bazel.io runs for Windows, and set the
top-level test_suite as the CI test target.

Doing so shortens the command line and works
around #3742

I verified that the old set of tests are the same
as the new set.

Change-Id: Id8d5da3f0c03c9b8969a9f8e1e9a3096888365aa
PiperOrigin-RevId: 169242858
@laszlocsomor
Copy link
Contributor

laszlocsomor commented Sep 20, 2017

related commit: bazelbuild/continuous-integration@61b5986

@damienmg
Copy link
Contributor

This one is fixed, once and for all :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakage P1 I'll work on this now. (Assignee required) platform: windows
Projects
None yet
Development

No branches or pull requests

5 participants