ropensci / beastier

R package to run BEAST2
https://docs.ropensci.org/beastier
GNU General Public License v3.0
11 stars 1 forks source link

Prevent BEAST2 freeze when overwriting a log file with overwrite set to false #50

Open richelbilderbeek opened 5 years ago

richelbilderbeek commented 5 years ago
test_that("BEAST2 freezes when treelog file already exists", {

  skip("Issue 50, Issue #50")

  if (!is_beast2_installed()) return()

  beast2_xml_filename <- tempfile(
    pattern = "beast2_", tmpdir = rappdirs::user_cache_dir(),
    fileext = ".xml"
  )

  beautier::create_beast2_input_file_from_model(
    input_filename = beautier::get_fasta_filename(),
    output_filename = beast2_xml_filename,
    inference_model = beautier::create_test_inference_model(
      mcmc = beautier::create_test_mcmc(
        screenlog = beautier::create_screenlog(filename = "")
      )
    )
  )
  testit::assert(file.exists(beast2_xml_filename))

  # First run works fine, takes approx 1 sec on my computer
  beastier::run_beast2_from_options(
    beastier::create_beast2_options(
      input_filename = beast2_xml_filename,
      overwrite = FALSE,
      verbose = TRUE
    )
  )

  # Second run causes BEAST2 to freeze
  beastier::run_beast2_from_options(
    beastier::create_beast2_options(
      input_filename = beast2_xml_filename,
      overwrite = FALSE,
      verbose = TRUE
    )
  )

})