Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
e945c66f
Commit
e945c66f
authored
5 years ago
by
flycash
Browse files
Options
Downloads
Patches
Plain Diff
format code
parent
da6d29a4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
filter/filter_impl/active_filter_test.go
+1
-1
1 addition, 1 deletion
filter/filter_impl/active_filter_test.go
filter/filter_impl/hystrix_filter_test.go
+4
-4
4 additions, 4 deletions
filter/filter_impl/hystrix_filter_test.go
with
5 additions
and
5 deletions
filter/filter_impl/active_filter_test.go
+
1
−
1
View file @
e945c66f
...
...
@@ -28,7 +28,7 @@ func TestActiveFilter_Invoke(t *testing.T) {
invoker
:=
mock
.
NewMockInvoker
(
ctrl
)
invoker
.
EXPECT
()
.
Invoke
(
gomock
.
Any
())
.
Return
(
nil
)
invoker
.
EXPECT
()
.
GetUrl
()
.
Return
(
url
)
.
Times
(
1
)
filter
.
Invoke
(
context
.
TODO
(),
invoker
,
invoc
)
filter
.
Invoke
(
context
.
TODO
(),
invoker
,
invoc
)
assert
.
True
(
t
,
invoc
.
AttachmentsByKey
(
dubboInvokeStartTime
,
""
)
!=
""
)
}
...
...
This diff is collapsed.
Click to expand it.
filter/filter_impl/hystrix_filter_test.go
+
4
−
4
View file @
e945c66f
...
...
@@ -145,7 +145,7 @@ func (iv *testMockFailInvoker) Invoke(ctx context.Context, invocation protocol.I
func
TestHystrixFilter_Invoke_Success
(
t
*
testing
.
T
)
{
hf
:=
&
HystrixFilter
{}
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockSuccessInvoker
{},
&
invocation
.
RPCInvocation
{})
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockSuccessInvoker
{},
&
invocation
.
RPCInvocation
{})
assert
.
NotNil
(
t
,
result
)
assert
.
NoError
(
t
,
result
.
Error
())
assert
.
NotNil
(
t
,
result
.
Result
())
...
...
@@ -153,7 +153,7 @@ func TestHystrixFilter_Invoke_Success(t *testing.T) {
func
TestHystrixFilter_Invoke_Fail
(
t
*
testing
.
T
)
{
hf
:=
&
HystrixFilter
{}
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockFailInvoker
{},
&
invocation
.
RPCInvocation
{})
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockFailInvoker
{},
&
invocation
.
RPCInvocation
{})
assert
.
NotNil
(
t
,
result
)
assert
.
Error
(
t
,
result
.
Error
())
}
...
...
@@ -165,7 +165,7 @@ func TestHystricFilter_Invoke_CircuitBreak(t *testing.T) {
resChan
:=
make
(
chan
protocol
.
Result
,
50
)
for
i
:=
0
;
i
<
50
;
i
++
{
go
func
()
{
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockFailInvoker
{},
&
invocation
.
RPCInvocation
{})
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockFailInvoker
{},
&
invocation
.
RPCInvocation
{})
resChan
<-
result
}()
}
...
...
@@ -190,7 +190,7 @@ func TestHystricFilter_Invoke_CircuitBreak_Omit_Exception(t *testing.T) {
resChan
:=
make
(
chan
protocol
.
Result
,
50
)
for
i
:=
0
;
i
<
50
;
i
++
{
go
func
()
{
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockFailInvoker
{},
&
invocation
.
RPCInvocation
{})
result
:=
hf
.
Invoke
(
context
.
TODO
(),
&
testMockFailInvoker
{},
&
invocation
.
RPCInvocation
{})
resChan
<-
result
}()
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment