Skip to content

Commit

Permalink
Cover GVOQ watermark bytes in watermark test
Browse files Browse the repository at this point in the history
Summary:
Include GVOQ watermark checks in queue watermark tests for supported platforms.

   OK : 4
   FAILED : 2
   SKIPPED : 0
   TIMEOUT : 0
```

Reviewed By: jasmeetbagga

Differential Revision: D61815514

fbshipit-source-id: a18c6f10266dfd8ce5bad94f9306be8861249d9a
  • Loading branch information
Nivin Lawrence authored and facebook-github-bot committed Aug 30, 2024
1 parent 0667edc commit 8046695
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion fboss/agent/test/agent_hw_tests/AgentWatermarkTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,24 @@ class AgentWatermarkTest : public AgentHwTest {
auto portName =
getProgrammedState()->getPorts()->getNodeIf(port)->getName();
bool statsConditionMet = false;
std::string egressGvoqWatermarkBytesLog{};
WITH_RETRIES({
queueWaterMarks = getQueueWatermarks(port, isVoq);
XLOG(DBG2) << "Port: " << portName << queueTypeStr << queueId
<< " Watermark: " << queueWaterMarks[queueId];
statsConditionMet = (expectZero && !queueWaterMarks[queueId]) ||
(!expectZero && queueWaterMarks[queueId]);
EXPECT_EVENTUALLY_TRUE(statsConditionMet);
if (isSupportedOnAllAsics(HwAsic::Feature::EGRESS_GVOQ_WATERMARK_BYTES)) {
uint64_t egressGvoqWatermarkBytes =
(*getLatestPortStats(port).egressGvoqWatermarkBytes_())[queueId];
statsConditionMet &=
((expectZero && !egressGvoqWatermarkBytes) ||
(!expectZero && egressGvoqWatermarkBytes));
EXPECT_EVENTUALLY_TRUE(statsConditionMet);
egressGvoqWatermarkBytesLog = ", GVOQ watermark bytes: " +
std::to_string(egressGvoqWatermarkBytes);
}
});

if (!statsConditionMet) {
Expand All @@ -235,7 +246,8 @@ class AgentWatermarkTest : public AgentHwTest {
<< " watermark value!";
} else {
XLOG(DBG2) << "Port: " << portName << queueTypeStr << queueId
<< " got expected watermarks of " << queueWaterMarks[queueId];
<< " got expected queue watermarks of "
<< queueWaterMarks[queueId] << egressGvoqWatermarkBytesLog;
}
// Check fb303
checkFb303BufferWatermarkUcast(port, queueId, isVoq);
Expand Down

0 comments on commit 8046695

Please sign in to comment.