fix windows compile bug (#9741)

Co-authored-by: 灵洵 <fengbin.ffb@antfin.com>
This commit is contained in:
fangfengbin 2020-07-28 21:30:31 +08:00 committed by GitHub
parent 6e23aff723
commit bd18e975c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1140,12 +1140,12 @@ TEST_F(ServiceBasedGcsClientTest, TestMultiThreadSubAndUnsub) {
threads.resize(size);
// The number of times each thread executes subscribe & resubscribe & unsubscribe.
const int sub_and_unsub_loop_count = 20;
int sub_and_unsub_loop_count = 20;
// Multithreading subscribe/resubscribe/unsubscribe actors.
auto job_id = JobID::FromInt(1);
for (int index = 0; index < size; ++index) {
threads[index].reset(new std::thread([this, job_id] {
threads[index].reset(new std::thread([this, sub_and_unsub_loop_count, job_id] {
for (int index = 0; index < sub_and_unsub_loop_count; ++index) {
auto actor_id = ActorID::Of(job_id, RandomTaskId(), 0);
ASSERT_TRUE(SubscribeActor(
@ -1162,7 +1162,7 @@ TEST_F(ServiceBasedGcsClientTest, TestMultiThreadSubAndUnsub) {
// Multithreading subscribe/resubscribe/unsubscribe objects.
for (int index = 0; index < size; ++index) {
threads[index].reset(new std::thread([this] {
threads[index].reset(new std::thread([this, sub_and_unsub_loop_count] {
for (int index = 0; index < sub_and_unsub_loop_count; ++index) {
auto object_id = ObjectID::FromRandom();
ASSERT_TRUE(SubscribeToLocations(