Alex created FLINK-12513:
----------------------------
Summary: Improve end-to-end (bash based) tests
Key: FLINK-12513
URL: https://issues.apache.org/jira/browse/FLINK-12513
Project: Flink
Issue Type: Improvement
Components: Tests
Reporter: Alex
Assignee: Alex
Fix For: 1.9.0
Tests in {{flink-end-to-end-tests/test-scripts}} directory are re-using the
same Flink directory to configure and launch a Flink cluster for a test.
As part of their setup steps, they may modify Flink config files (application
config, logs config), the directory itself (e.g. by copying some jars into
{{lib}} folder). Also, some tests involve using additional services (like
spinning up Zookeper, Kafka and so on clusters).
The corresponding clean up code (to stop services, to revert Flink directory to
original state) is spread out and a little bit not well-structured. In
particular
* the test runner itself reverts the Flink config (but doesn't revert other
changes in Flink dir);
* some tests use shell's {{trap}} on exit hook for clean up callback. Adding
multiple of such callbacks in one test would result in non-proper test tear
down.
As the result, some tests may have left overs that may affect execution of next
steps.
The proposal is to introduce a helper method for using one global (per test
run) {{trap}} hook that would enable adding multiple clean up callbacks. This
should enable registering "resource" clean up callbacks in the same place where
resource is used/launched.
Optional improvement: make the test runner create a temporal copy of Flink
directory and launch test using that temporal directory. After the test is
done, the temporal directory would be removed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)