forked from trustification/trustification
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deunstable the spog_dependencies integ test
Fixes trustification#618 We wait on guac up to the ntest::timeout value, 30s. This should account for a slow-to-start-up guac container. Signed-off-by: Jim Crossley <[email protected]>
- Loading branch information
1 parent
61b5fd7
commit a607b04
Showing
1 changed file
with
6 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,6 @@ async fn spog_search_correlation(context: &mut SpogContext) { | |
|
||
/// SPoG is the entrypoint for the frontend. It exposes an dependencies API, but forwards requests | ||
/// to Guac. This test is here to test this. | ||
#[ignore = "Unstable test, issue #618"] | ||
#[test_context(SpogContext)] | ||
#[tokio::test] | ||
#[ntest::timeout(30_000)] | ||
|
@@ -196,7 +195,6 @@ async fn spog_dependencies(context: &mut SpogContext) { | |
|
||
let purl: &str = "pkg:rpm/redhat/[email protected]"; | ||
|
||
let mut attempt = 1; | ||
loop { | ||
let response = client | ||
.get(context.urlify("/api/v1/packages")) | ||
|
@@ -207,17 +205,13 @@ async fn spog_dependencies(context: &mut SpogContext) { | |
.send() | ||
.await | ||
.unwrap(); | ||
assert_eq!(response.status(), StatusCode::OK); | ||
|
||
let payload: Value = response.json().await.unwrap(); | ||
let pkgs = payload.as_array().unwrap(); | ||
if pkgs.contains(&json!({"purl": "pkg:rpm/[email protected]?arch=x86_64"})) { | ||
break; | ||
if response.status() == StatusCode::OK { | ||
let payload: Value = response.json().await.unwrap(); | ||
let pkgs = payload.as_array().unwrap(); | ||
if pkgs.contains(&json!({"purl": "pkg:rpm/[email protected]?arch=x86_64"})) { | ||
break; | ||
} | ||
} | ||
|
||
attempt += 1; | ||
assert!(attempt < 10, "Guac ingestion failed, no packages available"); | ||
// wait a bit until the SBOM gets ingested into Guac | ||
tokio::time::sleep(Duration::from_secs(1)).await; | ||
} | ||
|
||
|