-
Notifications
You must be signed in to change notification settings - Fork 95
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
Terminate proccess's when experiencing a fatal error in ductape runner #323
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright 2022 Confluent Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
from ducktape.cluster.cluster_spec import ClusterSpec, WINDOWS, LINUX, NodeSpec | ||
from ducktape.services.service import Service | ||
from ducktape.tests.test import Test | ||
from ducktape.errors import TimeoutError | ||
from ducktape.mark.resource import cluster | ||
import time | ||
|
||
|
||
|
||
|
||
class SimpleEchoService(Service): | ||
"""Simple service that allocates one node for performing tests of RemoteAccount functionality""" | ||
logs = { | ||
"my_log": { | ||
"path": "/tmp/log", | ||
"collect_default": True | ||
}, | ||
} | ||
|
||
def __init__(self, context): | ||
super(SimpleEchoService, self).__init__(context, num_nodes=1) | ||
self.count = 0 | ||
|
||
def echo(self): | ||
self.nodes[0].account.ssh("echo {} >> /tmp/log".format(self.count)) | ||
self.count += 1 | ||
|
||
class SimpleRunnerTest(Test): | ||
def setup(self): | ||
self.service = SimpleEchoService(self.test_context) | ||
|
||
@cluster(num_nodes=1) | ||
def timeout_test(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would probably want to test with multiple tests in flight - some scheduled in parallel, some still yet to schedule (maybe just run for all systests?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well i run in parallel for the unit test as well, but yes ran in systest with some tests yet to schedule etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see #323 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in #323 you're saying that you've tested with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah for sure ill give it a run, ran it with repeat to simulate a bunch of test being run but yeah lets get the complete coverage. |
||
""" | ||
a simple longer running test to test special run flags agaisnt. | ||
""" | ||
self.service.start() | ||
|
||
while self.service.count < 100000000: | ||
self.service.echo() | ||
time.sleep(.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also compare this to https://github.com/confluentinc/ducktape/blob/master/ducktape/tests/runner.py#L124 which uses
os.kill
vsterminate()
- what's the difference and pros/cons?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would probably be good to have a unified
cleanup_child_processes
method or smthThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you read the docs for terminate:
which seems to be more platform agnostic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about modifying that other line too then? Can be a separate PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah might be best to touch it in another pr with more testing.