Commit 90cb8fd4 authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Ad-hoc test for reproducing bug 671969, commented out.

parent a4e914de
Pipeline #56683 passed with stages
in 9 minutes and 13 seconds
......@@ -2785,6 +2785,57 @@ test_bat_sd_zfp()
do_testbat<float, 64, true>(cad.name());
}
#if 0 // Only for ad-hoc debugging
namespace {
SeismicStoreIOContext getContext()
{
using InternalZGY::Environment;
return SeismicStoreIOContext()
.sdurl(Environment::getStringEnv("OPENZGY_SDURL"))
.sdapikey(Environment::getStringEnv("OPENZGY_SDAPIKEY"))
.sdtoken(Environment::getStringEnv("OPENZGY_TOKEN") != "" ?
Environment::getStringEnv("OPENZGY_TOKEN") :
"FILE:carbon.slbapp.com", "");
}
}
/**
* Not usable as an automated test.
* Partly because it takes two hours to run, waiting for the access
* token to expire, and partly because somebody needs to check by hand
* that garbage data was not output to the console.
*/
static void test_bug_671969()
{
auto ctxt = getContext();
std::shared_ptr<OpenZGY::IZgyReader> reader =
OpenZGY::IZgyReader::open("sd://sntc/testdata/Synt2.zgy", &ctxt);
const std::array<std::int64_t,3> orig{0,0,0};
const std::array<std::int64_t,3> more{64,192,64};
const std::array<std::int64_t,3> size{64,64,64};
std::unique_ptr<float[]>buf(new float[64*64*64]);
try {
std::cerr << "1st read" << std::endl;
reader->read(orig, size, buf.get(), 0);
for (int ii=10; ii>0; --ii) {
std::cerr << ii << "... " << std::flush;
std::this_thread::sleep_for (std::chrono::minutes(12));
}
std::cerr << "0!" << std::endl;
std::cerr << "2nd read" << std::endl;
reader->read(more, size, buf.get(), 0);
std::cerr << "close" << std::endl;
reader->close();
std::cerr << "done" << std::endl;
}
catch(const std::exception& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
}
}
#endif // Ad-hoc debugging
#endif
class Register
......@@ -2863,6 +2914,9 @@ public:
register_sd_test("api.bat_sd_2", test_bat_sd_2);
register_sd_test("api.bat_sd_4", test_bat_sd_4);
register_sd_test("api.bat_sd_zfp", test_bat_sd_zfp);
#if 0 // Not usable as an automated test
register_sd_test("bug.671969", test_bug_671969);
#endif
#endif
}
} dummy;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment