-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw an informative error if two local pipelines are running at the …
…same time on the same data store
- Loading branch information
1 parent
6177844
commit b9642a9
Showing
7 changed files
with
86 additions
and
7 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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
tar_test("error running two pipelines on _targets/ at the same time", { | ||
tar_script(tar_target(x, Sys.sleep(120))) | ||
process <- tar_make(callr_function = callr::r_bg) | ||
on.exit(process$kill()) | ||
Sys.sleep(5) | ||
tar_script(tar_target(x, TRUE)) | ||
for (index in seq_len(2L)) { | ||
expect_error( | ||
tar_make(callr_function = NULL), | ||
class = "tar_condition_validate" | ||
) | ||
} | ||
temp <- tempfile() | ||
on.exit(unlink(temp, recursive = TRUE), add = TRUE) | ||
tar_make(callr_function = NULL, store = temp) | ||
expect_true(tar_read(x, store = temp)) | ||
process$kill() | ||
Sys.sleep(5) | ||
tar_script(tar_target(x, "x")) | ||
tar_make(callr_function = NULL) | ||
expect_equal(tar_read(x), "x") | ||
tar_script(tar_target(x, FALSE)) | ||
tar_make(callr_function = NULL) | ||
expect_false(tar_read(x)) | ||
}) |