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

test: fix TestHashKVWhenCompacting: ensure all goroutine finished #17313

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jan 24, 2024

Fix #17232

  • We should ensure all goroutines finished before exiting the test case
  • Compaction 100 times may take longer than 10s, so reduce the count from 100 to 50;

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@ahrtr
Copy link
Member Author

ahrtr commented Jan 24, 2024

Root cause:
When test timed out, it fails the test right away, and cleanup will be executed before exiting the test gouroutine, and the backend storage will be closed. The other two gouroutines may not have finished yet, so eventually run into nic porinter panicking.

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

Ensuring all goroutines finished is a good catch.

Have a question below about halving compaction count.

server/storage/mvcc/kvstore_test.go Outdated Show resolved Hide resolved
@ahrtr ahrtr force-pushed the TestHashKVWhenCompacting_20240124 branch from 4bfeba7 to 7319a7a Compare January 25, 2024 10:14
@ahrtr ahrtr force-pushed the TestHashKVWhenCompacting_20240124 branch from 7319a7a to f3071ed Compare January 25, 2024 10:20
@ahrtr ahrtr changed the title test: fix TestHashKVWhenCompacting: ensure all goroutine finished and reduce compaction count test: fix TestHashKVWhenCompacting: ensure all goroutine finished Jan 25, 2024
serathius
serathius previously approved these changes Jan 25, 2024
@serathius serathius dismissed their stale review January 25, 2024 12:13

Tested the change, didn't see any difference in results

@ahrtr ahrtr force-pushed the TestHashKVWhenCompacting_20240124 branch 2 times, most recently from da0f2b1 to f06c1c5 Compare January 25, 2024 12:57
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
@ahrtr ahrtr force-pushed the TestHashKVWhenCompacting_20240124 branch from f06c1c5 to c647614 Compare January 25, 2024 13:30
@ahrtr
Copy link
Member Author

ahrtr commented Jan 25, 2024

/test pull-etcd-unit-test

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@ahrtr
Copy link
Member Author

ahrtr commented Jan 25, 2024

ping @serathius

@ahrtr ahrtr merged commit b287378 into etcd-io:main Jan 25, 2024
39 checks passed
@ahrtr ahrtr deleted the TestHashKVWhenCompacting_20240124 branch June 12, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Some unit tests failed after adding three last commits
4 participants