Skip to content

Commit

Permalink
tests: Improve stability of release.createFromUrl()'s cleanup
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
thgreasi committed Dec 2, 2024
1 parent 13d87dd commit f7fd59a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions tests/integration/models/release.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ describe('Release Model', function () {
return;
}
const start = Date.now();
let imageCount = 0;
while (imageCount < TEST_SOURCE_CONTAINER_COUNT * releaseCount) {
imageCount = await balena.pine.get({
resource: 'image',
const releaseImageCount = 0;
while (releaseImageCount < TEST_SOURCE_CONTAINER_COUNT * releaseCount) {
releaseImageCount = await balena.pine.get({

Check failure on line 134 in tests/integration/models/release.spec.ts

View workflow job for this annotation

GitHub Actions / Flowzone / Test custom (windows-latest)

Cannot assign to 'releaseImageCount' because it is a constant.

Check failure on line 134 in tests/integration/models/release.spec.ts

View workflow job for this annotation

GitHub Actions / Flowzone / Test custom (ubuntu-latest)

Cannot assign to 'releaseImageCount' because it is a constant.

Check failure on line 134 in tests/integration/models/release.spec.ts

View workflow job for this annotation

GitHub Actions / Flowzone / Test custom (macos-latest)

Cannot assign to 'releaseImageCount' because it is a constant.
resource: 'release_image',
options: {
$count: {
$filter: {
is_a_build_of__service: {
is_part_of__release: {
$any: {
$alias: 's',
$alias: 'r',
$expr: {
s: {
application: appId,
r: {
belongs_to__application: appId,
},
},
},
Expand All @@ -150,7 +150,11 @@ describe('Release Model', function () {
},
},
});
if (imageCount === TEST_SOURCE_CONTAINER_COUNT * releaseCount) {

if (
releaseImageCount ===
TEST_SOURCE_CONTAINER_COUNT * releaseCount
) {
break;
}
// don't wait more than 30 seconds
Expand Down

0 comments on commit f7fd59a

Please sign in to comment.