You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most chain elements are handling resources somehow. Some elements create a private map for storing states; some of them use a metadata map from the context; some of them handle context-related events; and some of them do not, some of them doesn't handle error on the refresh request.
The inconsistent behavior produces memory leaks and unexpected behavior.
Define a set of must have checks for the chain element that will check does the element follow required conditions. The interface could be simple:
package sandbox
funcTestClientEdgeCases(t*testing.T, c networkservice.NetworkServiceClient) {/* TODO */ }
funcTestServerEdgeCases(t*testing.T, s networkservice.NetworkServiceServer) {/* TODO */ }
Example of usage:
package metrics_test
import"sandbox"import"metrics"// should be added in each chain elementfuncTestEdgeCases(t*testing.T) {
sandbox.TestServerEdgeCases(t, metrics.NewServer())
sandbox.TestClientEdgeCases(t, metrics.NewClient())
}
Scenarios
sequence of request + close => should not produce cpu/memory leaks
sequence of request + request failed by timeout => should not produce cpu/memory leaks
sequence of request + request failed by error in next => should not produce cpu/memory leaks
sequence of request + error in next => should not produce cpu/memory leaks
sequence of request + error in next + close => should not produce cpu/memory leaks
The text was updated successfully, but these errors were encountered:
denis-tingaikin
changed the title
Quality upgrade for NSM chain elements
Quality upgrade for NSM chain element testing
May 7, 2024
Motivation
Most chain elements are handling resources somehow. Some elements create a private map for storing states; some of them use a metadata map from the context; some of them handle context-related events; and some of them do not, some of them doesn't handle error on the refresh request.
The inconsistent behavior produces memory leaks and unexpected behavior.
It's a root cause of networkservicemesh/cmd-nsmgr#675.
Solution
Define a set of must have checks for the chain element that will check does the element follow required conditions. The interface could be simple:
Example of usage:
Scenarios
The text was updated successfully, but these errors were encountered: