Skip to content

Commit

Permalink
Smoke Tests Bug Fixes (#2094)
Browse files Browse the repository at this point in the history
We've seen some spurious smoke test failures recently because of being unable to decode the schema that comes back when its being watched. My hunch is that this is because we don't quite wait long enough in the test so this increases the timeout. To try and add some extra safety we also shutdown the `watch` command post-waiting so that the state of the file should be fixed before we attempt to read it. This should make this safer

This also includes a fix for the smoke tests so that Slack should actually get messaged when the workflow fails. Beforehand because it was relying on a state of the job looked up explicitly, if a job failed elsewhere it would cancel all other jobs so the messaging job would never run. However in this version and using the special `failure()` syntax we can run the messaging job whenever any task fails without it being skipped.
  • Loading branch information
jonathanrainer authored Sep 2, 2024
1 parent bed1af8 commit 624feff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-smokes-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
schedule:
- cron: '0 9 * * *'

name: "Run Smokes (Automated)"
name: "Run Smoke Tests (Automated)"
jobs:
calculate_correct_version_ranges:
name: "Calculate Correct Version Ranges"
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-24.04
needs: run-smokes
name: "Message Slack On Test Failure"
if: ${{ needs.run-smokes.result == 'failure' }}
if: ${{ failure() }}
steps:
- name: Send custom JSON data to Slack workflow
id: slack
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/graph/introspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ async fn e2e_test_rover_graph_introspect_watch(
schema_file
.write(new_schema.as_bytes())
.expect("Could not update schema");
tokio::time::sleep(Duration::from_secs(2)).await;
tokio::time::sleep(Duration::from_secs(5)).await;
child.kill().unwrap();
// Get the new result
out_file
.seek(SeekFrom::Start(0))
Expand All @@ -131,6 +132,4 @@ async fn e2e_test_rover_graph_introspect_watch(
asserting(&format!("changes which was {:?}, has no elements", changes))
.that(&changes)
.is_empty();

child.kill().unwrap();
}
5 changes: 2 additions & 3 deletions tests/e2e/subgraph/introspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ async fn e2e_test_rover_subgraph_introspect_watch(
schema_file
.write(new_schema.as_bytes())
.expect("Could not update schema");
tokio::time::sleep(Duration::from_secs(2)).await;
tokio::time::sleep(Duration::from_secs(5)).await;
child.kill().unwrap();
// Get the new result
out_file
.seek(SeekFrom::Start(0))
Expand All @@ -132,6 +133,4 @@ async fn e2e_test_rover_subgraph_introspect_watch(
asserting(&format!("changes which was {:?}, has no elements", changes))
.that(&changes)
.is_empty();

child.kill().unwrap();
}

0 comments on commit 624feff

Please sign in to comment.