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

[cdc][e2e] Unify logic to clean docker image when connector e2e test finished #2978

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

GOODBOY008
Copy link
Member

Unify logic to clean docker image when connector e2e test finished

@GOODBOY008
Copy link
Member Author

@gong @whhe How about use this unify logic to clean docker image after connector e2e test finished?

@@ -174,6 +177,33 @@ public void after() {
mysqlInventoryDatabase.dropDatabase();
}

@AfterClass
public static void afterClass() {
// list all images and remove the ones that are not flink images and mysql image
Copy link
Member

Choose a reason for hiding this comment

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

Images with prefix testcontainers also need to be excluded.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fine, add the condition. The docker image of testcontainers just 12MB.

Copy link
Member

Choose a reason for hiding this comment

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

I mean exclude it to keep it not be deleted here, or else I'm not sure if there will be any exception occurs as it should still be in use. By the way, should the filters be combined with || or &&?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use &&

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch for this

@gong
Copy link
Contributor

gong commented Jan 9, 2024

PostgresE2eITCase remove images after we need stop POSTGRES container. @GOODBOY008

@GOODBOY008
Copy link
Member Author

emm,ob database container will not close after test.

@whhe
Copy link
Member

whhe commented Jan 9, 2024

emm,ob database container will not close after test.

I'm not sure, maybe ClassRule is executed after AfterClass? If so we need to add After method to stop the ob container manually.

@gong
Copy link
Contributor

gong commented Jan 9, 2024

@GOODBOY008 Maybe we can add @beforeClass for PostgresE2eITCase to start container.

@GOODBOY008
Copy link
Member Author

@GOODBOY008 Maybe we can add @beforeClass for PostgresE2eITCase to start container.

I think unify clean logic, just focus on final state.

Copy link
Member

@whhe whhe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@gong gong left a comment

Choose a reason for hiding this comment

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

LGTM

@GOODBOY008
Copy link
Member Author

@gong @whhe Thanks for your kind advises.

@GOODBOY008 GOODBOY008 merged commit a24c5d1 into apache:master Jan 10, 2024
17 checks passed
@GOODBOY008 GOODBOY008 deleted the master-e2e-clean branch January 11, 2024 15:57
lvyanquan pushed a commit that referenced this pull request Jan 18, 2024
joyCurry30 pushed a commit to joyCurry30/flink-cdc-connectors that referenced this pull request Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants