mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 09:19:24 +00:00
Sync test: keep running for 2 minutes more
This commit is contained in:
parent
325f2dc22f
commit
6a4583f758
4 changed files with 34 additions and 20 deletions
12
.github/workflows/test-sync.yml
vendored
12
.github/workflows/test-sync.yml
vendored
|
@ -28,14 +28,14 @@ jobs:
|
|||
make -j$(nproc)
|
||||
|
||||
- name: Run p2pool
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy1.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy2.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy3.log &
|
||||
TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1" ./p2pool --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1" ./p2pool --host xmrnode.facspro.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
|
@ -68,14 +68,14 @@ jobs:
|
|||
make -j3
|
||||
|
||||
- name: Run p2pool
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy1.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy2.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy3.log &
|
||||
./p2pool --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
./p2pool --host xmrnode.facspro.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
|
@ -108,14 +108,14 @@ jobs:
|
|||
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\msbuild" /m /p:Configuration=Debug p2pool.vcxproj
|
||||
|
||||
- name: Run p2pool
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
cd build/Debug
|
||||
mkdir data
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py stratum_dummy1.log"
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py stratum_dummy2.log"
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py stratum_dummy3.log"
|
||||
./p2pool.exe --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
./p2pool.exe --host xmrnode.facspro.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
findstr /C:"Synchronization finished successfully" p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
|
|
|
@ -174,7 +174,11 @@ CurlContext::CurlContext(const std::string& address, int port, const std::string
|
|||
curl_easy_setopt_checked(m_handle, CURLOPT_WRITEFUNCTION, write_func);
|
||||
curl_easy_setopt_checked(m_handle, CURLOPT_WRITEDATA, this);
|
||||
|
||||
#ifdef DEV_TEST_SYNC
|
||||
const int timeout = 10;
|
||||
#else
|
||||
const int timeout = proxy.empty() ? 1 : 5;
|
||||
#endif
|
||||
|
||||
curl_easy_setopt_checked(m_handle, CURLOPT_URL, m_url.c_str());
|
||||
curl_easy_setopt_checked(m_handle, CURLOPT_POSTFIELDS, m_req.c_str());
|
||||
|
|
|
@ -66,6 +66,9 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name)
|
|||
, m_chainWindowSize(2160)
|
||||
, m_unclePenalty(20)
|
||||
, m_precalcFinished(false)
|
||||
#ifdef DEV_TEST_SYNC
|
||||
, m_synchronizedTime(0)
|
||||
#endif
|
||||
{
|
||||
if (s_networkType == NetworkType::Invalid) {
|
||||
s_networkType = type;
|
||||
|
@ -1722,6 +1725,9 @@ void SideChain::update_chain_tip(const PoolBlock* block)
|
|||
// Also clear cache because it has data from all old blocks now
|
||||
clear_crypto_cache();
|
||||
LOGINFO(0, log::LightCyan() << "SYNCHRONIZED");
|
||||
#ifdef DEV_TEST_SYNC
|
||||
m_synchronizedTime = seconds_since_epoch();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
prune_old_blocks();
|
||||
|
@ -2028,6 +2034,20 @@ void SideChain::prune_old_blocks()
|
|||
|
||||
// Pre-calc workers are not needed anymore
|
||||
finish_precalc();
|
||||
|
||||
#ifdef DEV_TEST_SYNC
|
||||
if (m_pool && m_precalcFinished.load() && (cur_time >= m_synchronizedTime + 120)) {
|
||||
LOGINFO(0, log::LightGreen() << "[DEV] Synchronization finished successfully, stopping P2Pool now");
|
||||
print_status(false);
|
||||
P2PServer* server = m_pool->p2p_server();
|
||||
if (server) {
|
||||
server->print_status();
|
||||
server->print_bans();
|
||||
server->show_peers_async();
|
||||
}
|
||||
m_pool->stop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2278,20 +2298,6 @@ void SideChain::finish_precalc()
|
|||
{
|
||||
LOGERR(1, "exception in finish_precalc(): " << e.what());
|
||||
}
|
||||
|
||||
#ifdef DEV_TEST_SYNC
|
||||
if (m_pool) {
|
||||
LOGINFO(0, log::LightGreen() << "[DEV] Synchronization finished successfully, stopping P2Pool now");
|
||||
print_status(false);
|
||||
P2PServer* server = m_pool->p2p_server();
|
||||
if (server) {
|
||||
server->print_status();
|
||||
server->print_bans();
|
||||
server->show_peers_async();
|
||||
}
|
||||
m_pool->stop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace p2pool
|
||||
|
|
|
@ -152,6 +152,10 @@ private:
|
|||
|
||||
std::atomic<bool> m_precalcFinished;
|
||||
|
||||
#ifdef DEV_TEST_SYNC
|
||||
uint64_t m_synchronizedTime;
|
||||
#endif
|
||||
|
||||
hash m_consensusHash;
|
||||
|
||||
void launch_precalc(const PoolBlock* block);
|
||||
|
|
Loading…
Reference in a new issue