You can apply custom patch files as a post composer script
Use the attached patch files to correct this issue.
mkdir -p patches/composer/magento/module-staging/
nano patches/composer/magento/module-staging/fix-staging-test.patch
Then add the following to your composer.json
"extra": {
"composer-exit-on-patch-failure": true,
"patches": {
"magento/module-staging": {
"Fix broken staging unit test": "patches/composer/magento/module-staging/fix-staging-test.patch"
}
}
}