Skip to content

Commit

Permalink
Workaround in failing e2e test: await until outbox is flushed after c…
Browse files Browse the repository at this point in the history
…reating a dataset
  • Loading branch information
zaychenko-sergei committed Oct 10, 2024
1 parent bf93e38 commit da61ad7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ impl DatasetEntryService for DatasetEntryServiceImpl {

#[async_trait::async_trait]
impl DatasetRegistry for DatasetEntryServiceImpl {
#[tracing::instrument(level = "debug", skip_all)]
fn get_all_datasets(&self) -> DatasetHandleStream<'_> {
Box::pin(async_stream::try_stream! {
// Tracking pagination progress
Expand Down Expand Up @@ -336,6 +337,7 @@ impl DatasetRegistry for DatasetEntryServiceImpl {
})
}

#[tracing::instrument(level = "debug", skip_all, fields(%dataset_ref))]
async fn resolve_dataset_ref(
&self,
dataset_ref: &DatasetRef,
Expand Down
4 changes: 4 additions & 0 deletions src/e2e/app/cli/repo-tests/src/test_rest_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ pub async fn test_rest_api_request_dataset_tail(kamu_api_server_client: KamuApiS
.create_player_scores_dataset(&token)
.await;

// Workarround: await outbox, we should save a DatasetEntry before query start
// TODO: invent a way to flush outbox in e2e tests or to shorten waiting cycles
tokio::time::sleep(std::time::Duration::from_secs(2)).await;

// 3. Try to get the dataset tail
kamu_api_server_client
.rest_api_call_assert(
Expand Down

0 comments on commit da61ad7

Please sign in to comment.