Skip to content

Commit

Permalink
Adding defer () function to flush all entries before exit
Browse files Browse the repository at this point in the history
  • Loading branch information
nsadhasivam committed Jan 27, 2025
1 parent 5f6a91e commit 40caea7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ func testAdditionalCompliance(tcArgs *testArgs, t *testing.T) {
fn: addNHGReferencingToDownPort,
},
}

defer func() {
// Flush all entries after test.
if err := gribi.FlushAll(tcArgs.client); err != nil {
t.Error(err)
}
}()

for _, tt := range tests {
t.Run(tt.desc, func(t *testing.T) {
if err := gribi.FlushAll(tcArgs.client); err != nil {
Expand Down

0 comments on commit 40caea7

Please sign in to comment.