From 3e6d5b19cc89a7e54809b738bde1ce88c99d43be Mon Sep 17 00:00:00 2001 From: xloya <982052490@qq.com> Date: Fri, 13 Sep 2024 11:42:18 +0800 Subject: [PATCH] remove context finally --- .../server/web/rest/TestFilesetOperations.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/org/apache/gravitino/server/web/rest/TestFilesetOperations.java b/server/src/test/java/org/apache/gravitino/server/web/rest/TestFilesetOperations.java index b4db355f470..4b5e1f8649b 100644 --- a/server/src/test/java/org/apache/gravitino/server/web/rest/TestFilesetOperations.java +++ b/server/src/test/java/org/apache/gravitino/server/web/rest/TestFilesetOperations.java @@ -517,9 +517,13 @@ public void testGetFileLocation() { .thenAnswer( (Answer) invocation -> { - CallerContext context = CallerContext.CallerContextHolder.get(); - callerContextMap.putAll(context.context()); - return subPath2; + try { + CallerContext context = CallerContext.CallerContextHolder.get(); + callerContextMap.putAll(context.context()); + return subPath2; + } finally { + CallerContext.CallerContextHolder.remove(); + } }); Response resp4 = target(filesetPath(metalake, catalog, schema) + "fileset3/location")