Skip to content

MINOR:Start processor inside verify message#6029

Merged
guozhangwang merged 2 commits intoapache:trunkfrom
bbejeck:MINOR_start_processor_inside_verify_message
Dec 14, 2018
Merged

MINOR:Start processor inside verify message#6029
guozhangwang merged 2 commits intoapache:trunkfrom
bbejeck:MINOR_start_processor_inside_verify_message

Conversation

@bbejeck
Copy link
Copy Markdown
Member

@bbejeck bbejeck commented Dec 13, 2018

This PR fixes a flaky system test.

I ran six runs of branch builder, and each run was parameterized to repeat the test 25 times for a total of 150 runs. All test runs passed.

  1. https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2122/
  2. https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2123/
  3. https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2124/
  4. https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2128/
  5. https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2129/
  6. https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2130/

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

final StreamsBuilder builder = new StreamsBuilder();

final KStream<String, String> sourceStream = builder.stream(inputTopic, Consumed.with(Serdes.String(), Serdes.String()));
sourceStream.peek((k,v) -> System.out.println(String.format("input data key=%s, value=%s", k, v)));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Used for debugging I'd prefer to leave in should the test have problems in the future


self.zookeeper = ZookeeperService(self.test_context, num_nodes=1)
self.kafka = KafkaService(self.test_context, num_nodes=1,
self.kafka = KafkaService(self.test_context, num_nodes=3,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed this value to be consistent with other system tests

for processor in processors:
processor.CLEAN_NODE_ENABLED = False
self.set_topics(processor)
processor.start()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the fix removed start here and below

with processor.node.account.monitor_log(processor.STDOUT_FILE) as monitor:
node = processor.node
with node.account.monitor_log(processor.STDOUT_FILE) as monitor:
processor.start()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the other part of the fix moved processor start here

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.

What's the significance of after opening the monitor? Does it block on the log file somehow?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This closes a very small timing window, I've made similar changes in other system tests before

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@vvcephei If get don't get the monitor first, we might miss some output lines from the file in wait_until below and thus time out even if the correct output was written.

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.

👍

@bbejeck
Copy link
Copy Markdown
Member Author

bbejeck commented Dec 13, 2018

ping @guozhangwang, @mjsax, and @vvcephei for reviews

@mjsax mjsax added the streams label Dec 13, 2018
Copy link
Copy Markdown
Member

@mjsax mjsax left a comment

Choose a reason for hiding this comment

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

LGTM

@guozhangwang guozhangwang merged commit da332f2 into apache:trunk Dec 14, 2018
@guozhangwang
Copy link
Copy Markdown
Contributor

LGTM! Merged to trunk.

pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
@bbejeck bbejeck deleted the MINOR_start_processor_inside_verify_message branch July 10, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants