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

[FLINK-15442] Harden the Avro Confluent Schema Registry nightly end-to-end test #10742

Closed
wants to merge 2 commits into from

Conversation

KarmaGYZ
Copy link
Contributor

@KarmaGYZ KarmaGYZ commented Jan 2, 2020

What is the purpose of the change

Harden the Avro Confluent Schema Registry nightly end-to-end test.

Brief change log

  • Wrap the error when execute cleanup command in retry_times_with_backoff_and_cleanup function.
  • Harden the way to loop in retry_times_with_backoff_and_cleanup

Verifying this change

Trigger the Avro Confluent Schema Registry nightly end-to-end test.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? no

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 2, 2020

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit b542834 (Thu Jan 02 06:04:49 UTC 2020)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 2, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

@KarmaGYZ
Copy link
Contributor Author

KarmaGYZ commented Jan 3, 2020

cc @tillrohrmann
Travis gives green light to the relevant test.
https://travis-ci.org/KarmaGYZ/flink/builds/632126284

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR @KarmaGYZ. I left some comments as I don't fully understand why the changes are hardening the test script. At the moment, I thought that the downloading KAFKA_URL would be retried. Hence, I fear that your changes might not really have an effect.

@@ -748,7 +748,7 @@ function retry_times_with_backoff_and_cleanup() {
local command="$3"
local cleanup_command="$4"

for (( i = 0; i < ${retriesNumber}; i++ ))
for i in $(seq 1 ${retriesNumber})
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this better than the previous for loop version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This block of loop will only executes 1 time in this scenario. I found that there is also a for loop in start_confluent_schema_registry function:

for i in {1..30}; do
    if get_and_verify_schema_subjects_exist; then
        echo "Schema registry is up."
        return 0
    fi
    echo "Waiting for schema registry..."
    sleep 1
  done

The variable i is set to 30 after this function, which cause the loop end after only 1 execute.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried to reproduce the problem via

for i in {1..30}; do
  echo $i
done

for (( i = 0; i < 10; i++ )) do
  echo $i
done

When I execute this, then 1..30 and 0..9 will be printed. Hence, I'm not sure I really understand the problem you are describing. Could you provide me an example script to reproduce the problem with the old for loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think current scenario equals to the following script:

for (( i = 0; i < 10; i++ )) do
  for i in {1..30}; do
     echo $i
  done
  echo $i
done

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah this makes sense. Thanks a lot for your explanation.

flink-end-to-end-tests/test-scripts/kafka-common.sh Outdated Show resolved Hide resolved
@KarmaGYZ
Copy link
Contributor Author

KarmaGYZ commented Jan 7, 2020

Thanks for the review @tillrohrmann . I've updated the PR.

Travis link https://travis-ci.org/KarmaGYZ/flink/builds/633584290

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks for looking into my comments @KarmaGYZ. I fear I still don't understand the problem with the loops. I tried to reproduce what you've described but I wasn't able to do so. Could you provide me with a minimal example to reproduce the described problem?

@@ -748,7 +748,7 @@ function retry_times_with_backoff_and_cleanup() {
local command="$3"
local cleanup_command="$4"

for (( i = 0; i < ${retriesNumber}; i++ ))
for i in $(seq 1 ${retriesNumber})
Copy link
Contributor

Choose a reason for hiding this comment

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

I tried to reproduce the problem via

for i in {1..30}; do
  echo $i
done

for (( i = 0; i < 10; i++ )) do
  echo $i
done

When I execute this, then 1..30 and 0..9 will be printed. Hence, I'm not sure I really understand the problem you are describing. Could you provide me an example script to reproduce the problem with the old for loop?

flink-end-to-end-tests/test-scripts/kafka-common.sh Outdated Show resolved Hide resolved
flink-end-to-end-tests/test-scripts/kafka-common.sh Outdated Show resolved Hide resolved
@KarmaGYZ
Copy link
Contributor Author

KarmaGYZ commented Jan 7, 2020

Thanks for the review @tillrohrmann . I've removed the retry-delay and explained what happened in the loop.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the hardening and the explanation why it works @KarmaGYZ. LGTM. Merging this PR now.

@@ -748,7 +748,7 @@ function retry_times_with_backoff_and_cleanup() {
local command="$3"
local cleanup_command="$4"

for (( i = 0; i < ${retriesNumber}; i++ ))
for i in $(seq 1 ${retriesNumber})
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah this makes sense. Thanks a lot for your explanation.

tillrohrmann pushed a commit that referenced this pull request Jan 7, 2020
@KarmaGYZ KarmaGYZ deleted the FLINK-15442 branch January 8, 2020 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants