From 90cb8fd4f8edb07cff81cf70294dea43c6a04b95 Mon Sep 17 00:00:00 2001 From: Paal Kvamme Date: Thu, 5 Aug 2021 09:51:35 +0200 Subject: [PATCH] Ad-hoc test for reproducing bug 671969, commented out. --- native/src/test/test_api.cpp | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/native/src/test/test_api.cpp b/native/src/test/test_api.cpp index 61162e4..52d4874 100644 --- a/native/src/test/test_api.cpp +++ b/native/src/test/test_api.cpp @@ -2785,6 +2785,57 @@ test_bat_sd_zfp() do_testbat(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 reader = + OpenZGY::IZgyReader::open("sd://sntc/testdata/Synt2.zgy", &ctxt); + const std::array orig{0,0,0}; + const std::array more{64,192,64}; + const std::array size{64,64,64}; + std::unique_ptrbuf(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; -- GitLab