-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Verify tests do not allocate resources early and do not leave them behind #15165
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
Changes from all commits
d69f190
dc2e26a
26470f1
acc98ce
07a85f4
c1f5f82
b3d4777
b5ede8b
3a4d930
c000675
5e55f2f
2ec7ae4
dc29639
5f0fcab
3853550
a244669
8d820a8
3841830
370c458
75ca786
6ae6b93
bad7a65
819d2ac
dcce266
5dbb14b
a8f3df7
d176c45
df2b3a7
ad44778
9aab8be
83a906c
f3e962e
8233aa4
1eae356
fc0ad15
420bafa
3826cd4
08b24b6
aa0e114
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 |
|---|---|---|
|
|
@@ -57,6 +57,7 @@ public void teardown() | |
| throws Exception | ||
| { | ||
| server.close(); | ||
| server = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ public void teardown() | |
| throws IOException | ||
| { | ||
| server.close(); | ||
| server = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,7 @@ public void tearDown() | |
| closeAll( | ||
| server, | ||
| executor::shutdownNow); | ||
| server = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,6 +107,7 @@ public void tearDown() | |
| throws Exception | ||
| { | ||
| server.close(); | ||
| server = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ public void tearDownServer() | |
| throws Exception | ||
| { | ||
| server.close(); | ||
| server = null; | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,6 +166,7 @@ public void tearDown() | |
| throws Exception | ||
| { | ||
| connection.close(); | ||
| connection = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,7 @@ public void teardown() | |
| throws Exception | ||
| { | ||
| server.close(); | ||
| server = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ public void teardown() | |
| throws Exception | ||
| { | ||
| server.close(); | ||
| server = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,10 +71,11 @@ public class TestMemoryRevokingScheduler | |
| private final SpillSpaceTracker spillSpaceTracker = new SpillSpaceTracker(DataSize.of(10, GIGABYTE)); | ||
| private final Map<QueryId, QueryContext> queryContexts = new HashMap<>(); | ||
|
|
||
| private MemoryPool memoryPool; | ||
| private TaskExecutor taskExecutor; | ||
| private ScheduledExecutorService executor; | ||
| private ScheduledExecutorService scheduledExecutor; | ||
| private SqlTaskExecutionFactory sqlTaskExecutionFactory; | ||
| private MemoryPool memoryPool; | ||
|
|
||
| private Set<OperatorContext> allOperatorContexts; | ||
|
|
||
|
|
@@ -83,7 +84,7 @@ public void setUp() | |
| { | ||
| memoryPool = new MemoryPool(DataSize.ofBytes(10)); | ||
|
|
||
| TaskExecutor taskExecutor = new TaskExecutor(8, 16, 3, 4, Ticker.systemTicker()); | ||
| taskExecutor = new TaskExecutor(8, 16, 3, 4, Ticker.systemTicker()); | ||
| taskExecutor.start(); | ||
|
|
||
| // Must be single threaded | ||
|
|
@@ -107,8 +108,12 @@ public void tearDown() | |
| { | ||
| queryContexts.clear(); | ||
| memoryPool = null; | ||
| taskExecutor.stop(); | ||
|
Member
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. should we use closer here to make sure all cleanup routines are called?
Member
Author
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 don't see a need to. |
||
| taskExecutor = null; | ||
| executor.shutdownNow(); | ||
| scheduledExecutor.shutdownNow(); | ||
| sqlTaskExecutionFactory = null; | ||
| allOperatorContexts = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,7 @@ public void setUp() | |
| public void tearDown() | ||
| { | ||
| queryRunner.close(); | ||
| queryRunner = null; | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.