Skip to content

Start running bazel C/C++ tests on mac#20510

Merged
jtattermusch merged 11 commits intogrpc:masterfrom
jtattermusch:bazel_test_on_mac
Nov 27, 2019
Merged

Start running bazel C/C++ tests on mac#20510
jtattermusch merged 11 commits intogrpc:masterfrom
jtattermusch:bazel_test_on_mac

Conversation

@jtattermusch
Copy link
Copy Markdown
Contributor

@jtattermusch jtattermusch commented Oct 7, 2019

Setup continuous C/C++ test under bazel.
The tests are setup very similar to linux/windows RBE tests, with the exception that Foundry doesn't support Mac executors, so the tests are still built and run locally (but the test results are uploaded to result store).

I will enable the tests on PRs once the test results on master are stable.

There is also a number of fixes to the bazel tests on mac:

@jtattermusch
Copy link
Copy Markdown
Contributor Author

Current failures from a local run
https://source.cloud.google.com/results/invocations/986ca05e-37c1-4cda-9686-755949594aea/targets

bazel --bazelrc=tools/remote_build/mac.bazelrc test //test/... --keep_going

@jtattermusch
Copy link
Copy Markdown
Contributor Author

jtattermusch commented Oct 7, 2019

One problem to overcome #20494 (I now understand what's going on)

@jtattermusch
Copy link
Copy Markdown
Contributor Author

jtattermusch commented Oct 17, 2019

The other problem is that with this hack:

#define GPR_PTHREAD_TLS 1
, on macos under bazel we're using GPR_PTHREAD_TLS instead of GPR_GCC_TLS, but that actually fixed our macos bazel but it breaks some of the tests
because the thread local storage in uninitialized. E.g.

Executing tests from //test/core/backoff:backoff_test
-----------------------------------------------------------------------------
D1017 10:13:21.109471000 4373829056 test_config.cc:384]                test slowdown factor: sanitizer=1, fixture=1, poller=1, total=1
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from BackOffTest
[ RUN      ] BackOffTest.ConstantBackOff
E1017 10:13:21.110358000 4373829056 tls_pthread.cc:26]                 assertion failed: 0 == pthread_setspecific(tls->key, (void*)value)

bazelbuild/bazel#4341

@jtattermusch
Copy link
Copy Markdown
Contributor Author

@jtattermusch jtattermusch force-pushed the bazel_test_on_mac branch 2 times, most recently from f8350b9 to fd4473a Compare October 23, 2019 13:04
@jtattermusch
Copy link
Copy Markdown
Contributor Author

@jtattermusch
Copy link
Copy Markdown
Contributor Author

@jtattermusch
Copy link
Copy Markdown
Contributor Author

@jtattermusch
Copy link
Copy Markdown
Contributor Author

I included the changes from #20864.

@jtattermusch
Copy link
Copy Markdown
Contributor Author

@jtattermusch jtattermusch changed the title WIP: Running bazel tests on mac Start running bazel C/C++ tests on mac Nov 25, 2019
@jtattermusch jtattermusch added lang/c++ release notes: no Indicates if PR should not be in release notes labels Nov 25, 2019
@jtattermusch
Copy link
Copy Markdown
Contributor Author

@veblush @rmstar this is ready for review.

An adhoc run with all the tests passing: https://source.cloud.google.com/results/invocations/5c6c4d70-d6a2-491e-adf0-6b9dcb9e7d27/targets I still might need to look into test flakes, but this is good enough for a start.

@jtattermusch jtattermusch marked this pull request as ready for review November 25, 2019 13:02
Copy link
Copy Markdown
Contributor

@rmstar rmstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm for CFStream

bool restore_home_env = false;
#if defined(GRPC_BAZEL_BUILD) && \
(defined(GPR_POSIX_ENV) || defined(GPR_LINUX_ENV))
// when running under bazel with locally, the HOME variable is not set
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: bazel with locally -> bazel locally

@jtattermusch
Copy link
Copy Markdown
Contributor Author

Known failures:
#21297
#20459
#21309

@jtattermusch jtattermusch merged commit aa40b1c into grpc:master Nov 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lang/c++ release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants