Skip to content
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

[Dynamic Buffer Calc] Stabilize the vs test #1679

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/test_buffer_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,17 @@ def setup_asic_db(self, dvs):
self.ingress_lossless_pool_oid = key

def check_new_profile_in_asic_db(self, dvs, profile):
diff = set(self.asic_db.get_keys("ASIC_STATE:SAI_OBJECT_TYPE_BUFFER_PROFILE")) - self.initProfileSet
if len(diff) == 1:
self.newProfileInAsicDb = diff.pop()
assert self.newProfileInAsicDb, "Can't get SAI OID for newly created profile {}".format(profile)
retry_count = 0
self.newProfileInAsicDb = None
while retry_count < 5:
retry_count += 1
diff = set(self.asic_db.get_keys("ASIC_STATE:SAI_OBJECT_TYPE_BUFFER_PROFILE")) - self.initProfileSet
if len(diff) == 1:
self.newProfileInAsicDb = diff.pop()
break
else:
time.sleep(1)
assert self.newProfileInAsicDb, "Can't get SAI OID for newly created profile {} after retry {} times".format(profile, retry_count)

# in case diff is empty, we just treat the newProfileInAsicDb cached the latest one
fvs = self.app_db.get_entry("BUFFER_PROFILE_TABLE", profile)
Expand Down