question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python tests are flaky on Windows

See original GitHub issue

http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=latest,PLATFORM_NAME=windows-x86_64/843/console

Bazel sometimes exist with exitcode = 2 unexpectedly

Traceback (most recent call last):
  File "c:\bazel_ci\temp\Bazel.runfiles_l9ffu5\runfiles\io_bazel\src\test\py\bazel\bazel_clean_test.py", line 30, in testBazelClean
    self.assertEqual(exit_code, 0)
AssertionError: 2 != 0

//cc @laszlocsomor Any idea?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
meteorcloudycommented, Jun 28, 2017

According to the error messages, Bazel sometimes cannot find VC through registry when running in python tests. This could be a problem caused by https://github.com/bazelbuild/bazel/issues/2675

Traceback (most recent call last):
  File "c:\bazel_ci\temp\Bazel.runfiles_b7xq91\runfiles\io_bazel\src\test\py\bazel\bazel_clean_test.py", line 33, in testBazelClean
    self.AssertExitCode(exit_code, 0, stderr)
  File "c:\bazel_ci\temp\Bazel.runfiles_b7xq91\runfiles\io_bazel\src\test\py\bazel\test_base.py", line 66, in AssertExitCode
    '(end stderr)------------------------------------------',
AssertionError: Bazel exited with 2 (expected 0), stderr:
(start stderr)----------------------------------------
INFO: $TEST_TMPDIR defined: output root default is 'C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591'.
Extracting Bazel installation...
........................................................................
____Loading package: @bazel_tools//tools/jdk
____Loading package: @local_config_xcode//
____Loading package: @local_jdk//
WARNING: C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: 'BAZEL_PYTHON' is not set, start looking for python in PATH.
.
WARNING: C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Python found at C:/python_27_amd64/files/python.exe
.
WARNING: C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: 'BAZEL_VC' is not set, start looking for the latest Visual C++ installed.
.
WARNING: C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Looking for VS%VERSION%COMNTOOLS environment variables,eg. VS140COMNTOOLS
.
WARNING: C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Looking for Visual C++ through registry
.
ERROR: in target '//external:cc_toolchain': no such package '@local_config_cc//': Traceback (most recent call last):
File "C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/cc_configure.bzl", line 32
configure_windows_toolchain(repository_ctx)
File "C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 320, in configure_windows_toolchain
_find_vc_path(repository_ctx)
File "C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 160, in _find_vc_path
auto_configure_fail("Visual C++ build tools not foun...")
File "C:/bazel_ci/temp/_bazel_system/lc40yure/execroot/io_bazel/_tmp/426fee9b66f3f890e99ba9b867f74591/_bazel_system/y6np-3ym/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 30, in auto_configure_fail
fail("\n%sAuto-Configuration Error:%s...))

Auto-Configuration Error: Visual C++ build tools not found on your machine.
1reaction
laszlocsomorcommented, Jun 27, 2017

I added more logging to those tests, will be pushed to GitHub soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flaky tests — pytest documentation
Flaky tests sometimes appear when a test suite is run in parallel (such as use of pytest-xdist). This can indicate a test is...
Read more >
How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >
flaky - PyPI
Flaky is a plugin for nose or pytest that automatically reruns flaky tests. Ideally, tests reliably pass or fail, but sometimes test fixtures...
Read more >
[Windows] flaky tests · Issue #21393 · ray-project/ray · GitHub
After enabling tests of test_runtime_env_plugin and test_runtime_env_env_vars (PR #21252) and python/ray/serve:* tests (PR #21107), the analysis at ...
Read more >
Improving developer productivity via flaky test management
Flaky tests are a well-known problem across the industry and Microsoft is no exception. To address the issues with flaky tests and to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found